Merge lp:~ted/indicator-application/name-hints into lp:indicator-application/0.4

Proposed by Ted Gould
Status: Merged
Merged at revision: 206
Proposed branch: lp:~ted/indicator-application/name-hints
Merge into: lp:indicator-application/0.4
Diff against target: 152 lines (+34/-13)
4 files modified
src/application-service-appstore.c (+5/-4)
src/application-service.xml (+2/-1)
src/indicator-application.c (+22/-8)
tests/test-approver.c (+5/-0)
To merge this branch: bzr merge lp:~ted/indicator-application/name-hints
Reviewer Review Type Date Requested Status
Conor Curran (community) Approve
Review via email: mp+67213@code.launchpad.net

Description of the change

Use the name-hint so that it'll bubble up and we can see how that works.

To post a comment you must log in.
208. By Ted Gould

Oops, should be a free

Revision history for this message
Conor Curran (cjcurran) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/application-service-appstore.c'
2--- src/application-service-appstore.c 2011-06-22 16:21:32 +0000
3+++ src/application-service-appstore.c 2011-07-07 15:42:24 +0000
4@@ -870,12 +870,12 @@
5 if (app->visible_state == VISIBLE_STATE_HIDDEN) {
6 /* Put on panel */
7 emit_signal (appstore, "ApplicationAdded",
8- g_variant_new ("(sisossss)", newicon,
9+ g_variant_new ("(sisosssss)", newicon,
10 get_position(app),
11 app->dbus_name, app->menu,
12 app->icon_theme_path,
13 app->label, app->guide,
14- newdesc));
15+ newdesc, app->id));
16 } else {
17 /* Icon update */
18 gint position = get_position(app);
19@@ -1265,11 +1265,12 @@
20 continue;
21 }
22
23- g_variant_builder_add (&builder, "(sisossss)", app->icon,
24+ g_variant_builder_add (&builder, "(sisosssss)", app->icon,
25 position++, app->dbus_name, app->menu,
26 app->icon_theme_path, app->label,
27 app->guide,
28- (app->icon_desc != NULL) ? app->icon_desc : "");
29+ (app->icon_desc != NULL) ? app->icon_desc : "",
30+ app->id);
31 }
32
33 out = g_variant_builder_end(&builder);
34
35=== modified file 'src/application-service.xml'
36--- src/application-service.xml 2011-02-25 03:50:05 +0000
37+++ src/application-service.xml 2011-07-07 15:42:24 +0000
38@@ -26,7 +26,7 @@
39
40 <!-- Methods -->
41 <method name="GetApplications">
42- <arg type="a(sisossss)" name="applications" direction="out" />
43+ <arg type="a(sisosssss)" name="applications" direction="out" />
44 </method>
45 <method name="ApplicationScrollEvent">
46 <arg type="s" name="dbusaddress" direction="in" />
47@@ -45,6 +45,7 @@
48 <arg type="s" name="label" direction="out" />
49 <arg type="s" name="labelguide" direction="out" />
50 <arg type="s" name="accessibledesc" direction="out" />
51+ <arg type="s" name="hint" direction="out" />
52 </signal>
53 <signal name="ApplicationRemoved">
54 <arg type="i" name="position" direction="out" />
55
56=== modified file 'src/indicator-application.c'
57--- src/indicator-application.c 2011-07-02 03:05:39 +0000
58+++ src/indicator-application.c 2011-07-07 15:42:24 +0000
59@@ -116,7 +116,7 @@
60 static void disconnected_helper (gpointer data, gpointer user_data);
61 static gboolean disconnected_kill (gpointer user_data);
62 static void disconnected_kill_helper (gpointer data, gpointer user_data);
63-static void application_added (IndicatorApplication * application, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, const gchar * label, const gchar * guide, const gchar * accessible_desc);
64+static void application_added (IndicatorApplication * application, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, const gchar * label, const gchar * guide, const gchar * accessible_desc, const gchar * hint);
65 static void application_removed (IndicatorApplication * application, gint position);
66 static void application_label_changed (IndicatorApplication * application, gint position, const gchar * label, const gchar * guide);
67 static void application_icon_changed (IndicatorApplication * application, gint position, const gchar * iconname, const gchar * icondesc);
68@@ -469,7 +469,7 @@
69 ApplicationEntry and signaling the indicator host that
70 we've got a new indicator. */
71 static void
72-application_added (IndicatorApplication * application, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, const gchar * label, const gchar * guide, const gchar * accessible_desc)
73+application_added (IndicatorApplication * application, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, const gchar * label, const gchar * guide, const gchar * accessible_desc, const gchar * hint)
74 {
75 g_return_if_fail(IS_INDICATOR_APPLICATION(application));
76 g_debug("Building new application entry: %s with icon: %s at position %i", dbusaddress, iconname, position);
77@@ -524,6 +524,12 @@
78 app->entry.accessible_desc = g_strdup(accessible_desc);
79 }
80
81+ if (hint == NULL || hint[0] == '\0') {
82+ app->entry.name_hint = NULL;
83+ } else {
84+ app->entry.name_hint = g_strdup(hint);
85+ }
86+
87 app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject));
88
89 /* Keep copies of these for ourself, just in case. */
90@@ -580,6 +586,12 @@
91 if (app->entry.menu != NULL) {
92 g_object_unref(G_OBJECT(app->entry.menu));
93 }
94+ if (app->entry.accessible_desc != NULL) {
95+ g_free((gchar *)app->entry.accessible_desc);
96+ }
97+ if (app->entry.name_hint != NULL) {
98+ g_free((gchar *)app->entry.name_hint);
99+ }
100 g_free(app);
101
102 return;
103@@ -775,13 +787,14 @@
104 const gchar * label;
105 const gchar * guide;
106 const gchar * accessible_desc;
107- g_variant_get (parameters, "(&si&s&o&s&s&s&s)", &iconname,
108+ const gchar * hint;
109+ g_variant_get (parameters, "(&si&s&o&s&s&s&s&s)", &iconname,
110 &position, &dbusaddress, &dbusobject,
111 &icon_theme_path, &label, &guide,
112- &accessible_desc);
113+ &accessible_desc, &hint);
114 application_added(self, iconname, position, dbusaddress,
115 dbusobject, icon_theme_path, label, guide,
116- accessible_desc);
117+ accessible_desc, hint);
118 }
119 else if (g_strcmp0(signal_name, "ApplicationRemoved") == 0) {
120 gint position;
121@@ -872,11 +885,12 @@
122 const gchar * label;
123 const gchar * guide;
124 const gchar * accessible_desc;
125- g_variant_get(variant, "(sisossss)", &icon_name, &position,
126+ const gchar * hint;
127+ g_variant_get(variant, "(sisosssss)", &icon_name, &position,
128 &dbus_address, &dbus_object, &icon_theme_path, &label,
129- &guide, &accessible_desc);
130+ &guide, &accessible_desc, &hint);
131
132- return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc);
133+ return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint);
134 }
135
136 /* Unrefs a theme directory. This may involve removing it from
137
138=== modified file 'tests/test-approver.c'
139--- tests/test-approver.c 2011-01-12 16:16:55 +0000
140+++ tests/test-approver.c 2011-07-07 15:42:24 +0000
141@@ -149,6 +149,11 @@
142
143 result = g_dbus_proxy_call_finish(proxy, res, &error);
144
145+ if (result != NULL) {
146+ g_variant_unref(result);
147+ result = NULL;
148+ }
149+
150 if (error != NULL) {
151 g_warning("Unable to register approver: %s", error->message);
152 g_error_free(error);

Subscribers

People subscribed via source and target branches