diff options
author | Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> | 2013-03-18 17:28:01 -0400 |
---|---|---|
committer | Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> | 2013-03-18 17:28:01 -0400 |
commit | c5f002fed099eaf06d9a7e7b2ce31af853f5f471 (patch) | |
tree | efe8286936ecc58523d1d8e848f6cfa240e2cafc /libindicator | |
parent | daf0dc90ac1f87ce02debd1cba9b1f084decee12 (diff) | |
download | libayatana-indicator-c5f002fed099eaf06d9a7e7b2ce31af853f5f471.tar.gz libayatana-indicator-c5f002fed099eaf06d9a7e7b2ce31af853f5f471.tar.bz2 libayatana-indicator-c5f002fed099eaf06d9a7e7b2ce31af853f5f471.zip |
Revert: indicator-ng: allow a dictionary as the root action's state
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-ng.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c index 1e95785..f2b957b 100644 --- a/libindicator/indicator-ng.c +++ b/libindicator/indicator-ng.c @@ -236,10 +236,6 @@ static void indicator_ng_update_entry (IndicatorNg *self) { GVariant *state; - const gchar *label = NULL; - const gchar *iconstr = NULL; - const gchar *accessible_desc = NULL; - gboolean visible = TRUE; g_return_if_fail (self->menu != NULL); g_return_if_fail (self->actions != NULL); @@ -254,25 +250,20 @@ indicator_ng_update_entry (IndicatorNg *self) state = g_action_group_get_action_state (self->actions, self->header_action); if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)"))) { + const gchar *label; + const gchar *iconstr; + const gchar *accessible_desc; + gboolean visible; + g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible); - } - else if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("a{sv}"))) - { - g_variant_lookup (state, "label", "&s", &label); - g_variant_lookup (state, "icon", "&s", &iconstr); - g_variant_lookup (state, "accessible-desc", "&s", &accessible_desc); - g_variant_lookup (state, "visible", "b", &visible); - } - else - g_warning ("the action of the indicator menu item must have state with type (sssb) or a{sv}"); - if (label) - indicator_ng_set_label (self, label); - if (iconstr) + indicator_ng_set_label (self, label); indicator_ng_set_icon_from_string (self, iconstr); - if (accessible_desc) - indicator_ng_set_accessible_desc (self, accessible_desc); - indicator_object_set_visible (INDICATOR_OBJECT (self), visible); + indicator_ng_set_accessible_desc (self, accessible_desc); + indicator_object_set_visible (INDICATOR_OBJECT (self), visible); + } + else + g_warning ("the action of the indicator menu item must have state with type (sssb)"); if (state) g_variant_unref (state); |