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
=== modified file 'src/application-service-appstore.c'
--- src/application-service-appstore.c 2011-06-22 16:21:32 +0000
+++ src/application-service-appstore.c 2011-07-07 15:42:24 +0000
@@ -870,12 +870,12 @@
870 if (app->visible_state == VISIBLE_STATE_HIDDEN) {870 if (app->visible_state == VISIBLE_STATE_HIDDEN) {
871 /* Put on panel */871 /* Put on panel */
872 emit_signal (appstore, "ApplicationAdded",872 emit_signal (appstore, "ApplicationAdded",
873 g_variant_new ("(sisossss)", newicon,873 g_variant_new ("(sisosssss)", newicon,
874 get_position(app),874 get_position(app),
875 app->dbus_name, app->menu,875 app->dbus_name, app->menu,
876 app->icon_theme_path,876 app->icon_theme_path,
877 app->label, app->guide,877 app->label, app->guide,
878 newdesc));878 newdesc, app->id));
879 } else {879 } else {
880 /* Icon update */880 /* Icon update */
881 gint position = get_position(app);881 gint position = get_position(app);
@@ -1265,11 +1265,12 @@
1265 continue;1265 continue;
1266 }1266 }
12671267
1268 g_variant_builder_add (&builder, "(sisossss)", app->icon,1268 g_variant_builder_add (&builder, "(sisosssss)", app->icon,
1269 position++, app->dbus_name, app->menu,1269 position++, app->dbus_name, app->menu,
1270 app->icon_theme_path, app->label,1270 app->icon_theme_path, app->label,
1271 app->guide,1271 app->guide,
1272 (app->icon_desc != NULL) ? app->icon_desc : "");1272 (app->icon_desc != NULL) ? app->icon_desc : "",
1273 app->id);
1273 }1274 }
12741275
1275 out = g_variant_builder_end(&builder);1276 out = g_variant_builder_end(&builder);
12761277
=== modified file 'src/application-service.xml'
--- src/application-service.xml 2011-02-25 03:50:05 +0000
+++ src/application-service.xml 2011-07-07 15:42:24 +0000
@@ -26,7 +26,7 @@
2626
27<!-- Methods -->27<!-- Methods -->
28 <method name="GetApplications">28 <method name="GetApplications">
29 <arg type="a(sisossss)" name="applications" direction="out" />29 <arg type="a(sisosssss)" name="applications" direction="out" />
30 </method>30 </method>
31 <method name="ApplicationScrollEvent">31 <method name="ApplicationScrollEvent">
32 <arg type="s" name="dbusaddress" direction="in" />32 <arg type="s" name="dbusaddress" direction="in" />
@@ -45,6 +45,7 @@
45 <arg type="s" name="label" direction="out" />45 <arg type="s" name="label" direction="out" />
46 <arg type="s" name="labelguide" direction="out" />46 <arg type="s" name="labelguide" direction="out" />
47 <arg type="s" name="accessibledesc" direction="out" />47 <arg type="s" name="accessibledesc" direction="out" />
48 <arg type="s" name="hint" direction="out" />
48 </signal>49 </signal>
49 <signal name="ApplicationRemoved">50 <signal name="ApplicationRemoved">
50 <arg type="i" name="position" direction="out" />51 <arg type="i" name="position" direction="out" />
5152
=== modified file 'src/indicator-application.c'
--- src/indicator-application.c 2011-07-02 03:05:39 +0000
+++ src/indicator-application.c 2011-07-07 15:42:24 +0000
@@ -116,7 +116,7 @@
116static void disconnected_helper (gpointer data, gpointer user_data);116static void disconnected_helper (gpointer data, gpointer user_data);
117static gboolean disconnected_kill (gpointer user_data);117static gboolean disconnected_kill (gpointer user_data);
118static void disconnected_kill_helper (gpointer data, gpointer user_data);118static void disconnected_kill_helper (gpointer data, gpointer user_data);
119static 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);119static 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);
120static void application_removed (IndicatorApplication * application, gint position);120static void application_removed (IndicatorApplication * application, gint position);
121static void application_label_changed (IndicatorApplication * application, gint position, const gchar * label, const gchar * guide);121static void application_label_changed (IndicatorApplication * application, gint position, const gchar * label, const gchar * guide);
122static void application_icon_changed (IndicatorApplication * application, gint position, const gchar * iconname, const gchar * icondesc);122static void application_icon_changed (IndicatorApplication * application, gint position, const gchar * iconname, const gchar * icondesc);
@@ -469,7 +469,7 @@
469 ApplicationEntry and signaling the indicator host that469 ApplicationEntry and signaling the indicator host that
470 we've got a new indicator. */470 we've got a new indicator. */
471static void471static void
472application_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)472application_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)
473{473{
474 g_return_if_fail(IS_INDICATOR_APPLICATION(application));474 g_return_if_fail(IS_INDICATOR_APPLICATION(application));
475 g_debug("Building new application entry: %s with icon: %s at position %i", dbusaddress, iconname, position);475 g_debug("Building new application entry: %s with icon: %s at position %i", dbusaddress, iconname, position);
@@ -524,6 +524,12 @@
524 app->entry.accessible_desc = g_strdup(accessible_desc);524 app->entry.accessible_desc = g_strdup(accessible_desc);
525 }525 }
526526
527 if (hint == NULL || hint[0] == '\0') {
528 app->entry.name_hint = NULL;
529 } else {
530 app->entry.name_hint = g_strdup(hint);
531 }
532
527 app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject));533 app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject));
528534
529 /* Keep copies of these for ourself, just in case. */535 /* Keep copies of these for ourself, just in case. */
@@ -580,6 +586,12 @@
580 if (app->entry.menu != NULL) {586 if (app->entry.menu != NULL) {
581 g_object_unref(G_OBJECT(app->entry.menu));587 g_object_unref(G_OBJECT(app->entry.menu));
582 }588 }
589 if (app->entry.accessible_desc != NULL) {
590 g_free((gchar *)app->entry.accessible_desc);
591 }
592 if (app->entry.name_hint != NULL) {
593 g_free((gchar *)app->entry.name_hint);
594 }
583 g_free(app);595 g_free(app);
584596
585 return;597 return;
@@ -775,13 +787,14 @@
775 const gchar * label;787 const gchar * label;
776 const gchar * guide;788 const gchar * guide;
777 const gchar * accessible_desc;789 const gchar * accessible_desc;
778 g_variant_get (parameters, "(&si&s&o&s&s&s&s)", &iconname,790 const gchar * hint;
791 g_variant_get (parameters, "(&si&s&o&s&s&s&s&s)", &iconname,
779 &position, &dbusaddress, &dbusobject,792 &position, &dbusaddress, &dbusobject,
780 &icon_theme_path, &label, &guide,793 &icon_theme_path, &label, &guide,
781 &accessible_desc);794 &accessible_desc, &hint);
782 application_added(self, iconname, position, dbusaddress,795 application_added(self, iconname, position, dbusaddress,
783 dbusobject, icon_theme_path, label, guide,796 dbusobject, icon_theme_path, label, guide,
784 accessible_desc);797 accessible_desc, hint);
785 }798 }
786 else if (g_strcmp0(signal_name, "ApplicationRemoved") == 0) {799 else if (g_strcmp0(signal_name, "ApplicationRemoved") == 0) {
787 gint position;800 gint position;
@@ -872,11 +885,12 @@
872 const gchar * label;885 const gchar * label;
873 const gchar * guide;886 const gchar * guide;
874 const gchar * accessible_desc;887 const gchar * accessible_desc;
875 g_variant_get(variant, "(sisossss)", &icon_name, &position,888 const gchar * hint;
889 g_variant_get(variant, "(sisosssss)", &icon_name, &position,
876 &dbus_address, &dbus_object, &icon_theme_path, &label,890 &dbus_address, &dbus_object, &icon_theme_path, &label,
877 &guide, &accessible_desc);891 &guide, &accessible_desc, &hint);
878892
879 return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc);893 return application_added(self, icon_name, position, dbus_address, dbus_object, icon_theme_path, label, guide, accessible_desc, hint);
880}894}
881895
882/* Unrefs a theme directory. This may involve removing it from896/* Unrefs a theme directory. This may involve removing it from
883897
=== modified file 'tests/test-approver.c'
--- tests/test-approver.c 2011-01-12 16:16:55 +0000
+++ tests/test-approver.c 2011-07-07 15:42:24 +0000
@@ -149,6 +149,11 @@
149149
150 result = g_dbus_proxy_call_finish(proxy, res, &error);150 result = g_dbus_proxy_call_finish(proxy, res, &error);
151151
152 if (result != NULL) {
153 g_variant_unref(result);
154 result = NULL;
155 }
156
152 if (error != NULL) {157 if (error != NULL) {
153 g_warning("Unable to register approver: %s", error->message);158 g_warning("Unable to register approver: %s", error->message);
154 g_error_free(error);159 g_error_free(error);

Subscribers

People subscribed via source and target branches