~townsend/unity/fix-dash-page-up-down

« back to all changes in this revision

Viewing changes to UnityCore/Preview.h

  • Committer: Daniel van Vugt
  • Date: 2012-09-13 10:56:42 UTC
  • mfrom: (2684 unity)
  • mto: This revision was merged to the branch mainline in revision 2698.
  • Revision ID: daniel.van.vugt@canonical.com-20120913105642-9on2ald55h54j1zn
Merge latest lp:unity and fix conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
    std::string id;
60
60
    std::string display_name;
61
61
    std::string icon_hint;
 
62
    std::string extra_text;
62
63
    LayoutHint layout_hint;
63
64
    // TODO: there's also a HashTable here (although unused atm)
64
65
 
65
66
    Action() {};
66
67
    Action(const gchar* id_, const gchar* display_name_,
67
 
           const gchar* icon_hint_, LayoutHint layout_hint_)
 
68
           const gchar* icon_hint_, LayoutHint layout_hint_,
 
69
           GHashTable* hints)
68
70
      : id(id_ != NULL ? id_ : "")
69
71
      , display_name(display_name_ != NULL ? display_name_ : "")
70
72
      , icon_hint(icon_hint_ != NULL ? icon_hint_ : "")
71
 
      , layout_hint(layout_hint_) {};
 
73
      , layout_hint(layout_hint_)
 
74
    {
 
75
      GHashTableIter iter;
 
76
      gpointer key, value;
 
77
      g_hash_table_iter_init(&iter, hints);
 
78
      while (g_hash_table_iter_next(&iter, &key, &value))
 
79
      {
 
80
        if (g_strcmp0((gchar*)key, "extra-text") == 0)
 
81
        {
 
82
          glib::Variant val(static_cast<GVariant*>(value));
 
83
          extra_text = val.GetString();
 
84
        }
 
85
      }
 
86
    };
72
87
  };
73
88
 
74
89
  struct InfoHint