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
1=== modified file 'libindicator/indicator-ng.c'
2--- libindicator/indicator-ng.c 2013-03-13 16:32:22 +0000
3+++ libindicator/indicator-ng.c 2013-03-20 19:24:27 +0000
4@@ -236,10 +236,6 @@
5 indicator_ng_update_entry (IndicatorNg *self)
6 {
7 GVariant *state;
8- const gchar *label = NULL;
9- const gchar *iconstr = NULL;
10- const gchar *accessible_desc = NULL;
11- gboolean visible = TRUE;
12
13 g_return_if_fail (self->menu != NULL);
14 g_return_if_fail (self->actions != NULL);
15@@ -254,25 +250,20 @@
16 state = g_action_group_get_action_state (self->actions, self->header_action);
17 if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))
18 {
19+ const gchar *label;
20+ const gchar *iconstr;
21+ const gchar *accessible_desc;
22+ gboolean visible;
23+
24 g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);
25- }
26- else if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("a{sv}")))
27- {
28- g_variant_lookup (state, "label", "&s", &label);
29- g_variant_lookup (state, "icon", "&s", &iconstr);
30- g_variant_lookup (state, "accessible-desc", "&s", &accessible_desc);
31- g_variant_lookup (state, "visible", "b", &visible);
32- }
33- else
34- g_warning ("the action of the indicator menu item must have state with type (sssb) or a{sv}");
35
36- if (label)
37- indicator_ng_set_label (self, label);
38- if (iconstr)
39+ indicator_ng_set_label (self, label);
40 indicator_ng_set_icon_from_string (self, iconstr);
41- if (accessible_desc)
42- indicator_ng_set_accessible_desc (self, accessible_desc);
43- indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
44+ indicator_ng_set_accessible_desc (self, accessible_desc);
45+ indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
46+ }
47+ else
48+ g_warning ("the action of the indicator menu item must have state with type (sssb)");
49
50 if (state)
51 g_variant_unref (state);
52
53=== modified file 'tests/indicator-test-service.c'
54--- tests/indicator-test-service.c 2013-03-13 16:32:22 +0000
55+++ tests/indicator-test-service.c 2013-03-20 19:24:27 +0000
56@@ -70,9 +70,7 @@
57 GMenuItem *item;
58 GMenu *submenu;
59 GActionEntry entries[] = {
60- { "_header", NULL, NULL, "{'label': <'Test'>,"
61- " 'icon': <'indicator-test'>,"
62- " 'accessible-desc': <'Test indicator'> }", NULL },
63+ { "_header", NULL, NULL, "('Test', 'indicator-test', 'Test indicator', true)", NULL },
64 { "show", activate_show, NULL, NULL, NULL }
65 };
66 GMainLoop *loop;

Subscribers

People subscribed via source and target branches