Merge lp:~cyphermox/libindicator/revert-indicator-ng into lp:libindicator/13.04

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Approved by: Michael Terry
Approved revision: 482
Merged at revision: 482
Proposed branch: lp:~cyphermox/libindicator/revert-indicator-ng
Merge into: lp:libindicator/13.04
Diff against target: 66 lines (+12/-23)
2 files modified
libindicator/indicator-ng.c (+11/-20)
tests/indicator-test-service.c (+1/-3)
To merge this branch: bzr merge lp:~cyphermox/libindicator/revert-indicator-ng
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Michael Terry Approve
Review via email: mp+154486@code.launchpad.net

Description of the change

Revert "indicator-ng: allow a dictionary as the root action's state"

This doesn't have a FFe and can't land.

It was initially filed against the 13.10 branch...

To post a comment you must log in.
Revision history for this message
Michael Terry (mterry) wrote :

Approve again then. :)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'libindicator/indicator-ng.c'
--- libindicator/indicator-ng.c 2013-03-13 16:32:22 +0000
+++ libindicator/indicator-ng.c 2013-03-20 19:24:27 +0000
@@ -236,10 +236,6 @@
236indicator_ng_update_entry (IndicatorNg *self)236indicator_ng_update_entry (IndicatorNg *self)
237{237{
238 GVariant *state;238 GVariant *state;
239 const gchar *label = NULL;
240 const gchar *iconstr = NULL;
241 const gchar *accessible_desc = NULL;
242 gboolean visible = TRUE;
243239
244 g_return_if_fail (self->menu != NULL);240 g_return_if_fail (self->menu != NULL);
245 g_return_if_fail (self->actions != NULL);241 g_return_if_fail (self->actions != NULL);
@@ -254,25 +250,20 @@
254 state = g_action_group_get_action_state (self->actions, self->header_action);250 state = g_action_group_get_action_state (self->actions, self->header_action);
255 if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))251 if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))
256 {252 {
253 const gchar *label;
254 const gchar *iconstr;
255 const gchar *accessible_desc;
256 gboolean visible;
257
257 g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);258 g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);
258 }
259 else if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("a{sv}")))
260 {
261 g_variant_lookup (state, "label", "&s", &label);
262 g_variant_lookup (state, "icon", "&s", &iconstr);
263 g_variant_lookup (state, "accessible-desc", "&s", &accessible_desc);
264 g_variant_lookup (state, "visible", "b", &visible);
265 }
266 else
267 g_warning ("the action of the indicator menu item must have state with type (sssb) or a{sv}");
268259
269 if (label)260 indicator_ng_set_label (self, label);
270 indicator_ng_set_label (self, label);
271 if (iconstr)
272 indicator_ng_set_icon_from_string (self, iconstr);261 indicator_ng_set_icon_from_string (self, iconstr);
273 if (accessible_desc)262 indicator_ng_set_accessible_desc (self, accessible_desc);
274 indicator_ng_set_accessible_desc (self, accessible_desc);263 indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
275 indicator_object_set_visible (INDICATOR_OBJECT (self), visible);264 }
265 else
266 g_warning ("the action of the indicator menu item must have state with type (sssb)");
276267
277 if (state)268 if (state)
278 g_variant_unref (state);269 g_variant_unref (state);
279270
=== modified file 'tests/indicator-test-service.c'
--- tests/indicator-test-service.c 2013-03-13 16:32:22 +0000
+++ tests/indicator-test-service.c 2013-03-20 19:24:27 +0000
@@ -70,9 +70,7 @@
70 GMenuItem *item;70 GMenuItem *item;
71 GMenu *submenu;71 GMenu *submenu;
72 GActionEntry entries[] = {72 GActionEntry entries[] = {
73 { "_header", NULL, NULL, "{'label': <'Test'>,"73 { "_header", NULL, NULL, "('Test', 'indicator-test', 'Test indicator', true)", NULL },
74 " 'icon': <'indicator-test'>,"
75 " 'accessible-desc': <'Test indicator'> }", NULL },
76 { "show", activate_show, NULL, NULL, NULL }74 { "show", activate_show, NULL, NULL, NULL }
77 };75 };
78 GMainLoop *loop;76 GMainLoop *loop;

Subscribers

People subscribed via source and target branches