Merge lp:~charlesk/indicator-sync/lp-1054310 into lp:indicator-sync/12.10

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 22
Merged at revision: 22
Proposed branch: lp:~charlesk/indicator-sync/lp-1054310
Merge into: lp:indicator-sync/12.10
Diff against target: 58 lines (+34/-2)
2 files modified
src/indicator/indicator-sync.c (+15/-2)
src/service/app-menu-item.c (+19/-0)
To merge this branch: bzr merge lp:~charlesk/indicator-sync/lp-1054310
Reviewer Review Type Date Requested Status
Lars Karlitski (community) Approve
Review via email: mp+127635@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Lars Karlitski (larsu) wrote :

Looks good, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/indicator/indicator-sync.c'
--- src/indicator/indicator-sync.c 2012-09-24 19:43:12 +0000
+++ src/indicator/indicator-sync.c 2012-10-03 05:50:26 +0000
@@ -481,9 +481,22 @@
481static void481static void
482app_update_icon (DbusmenuMenuitem * mi, struct AppWidgets * w)482app_update_icon (DbusmenuMenuitem * mi, struct AppWidgets * w)
483{483{
484 const gchar * icon_name = dbusmenu_menuitem_property_get (mi, APPLICATION_MENUITEM_PROP_ICON);484 GIcon * icon;
485 const gchar * str;
486 GError * error = NULL;
485487
486 gtk_image_set_from_icon_name (GTK_IMAGE(w->icon), icon_name, GTK_ICON_SIZE_MENU);488 str = dbusmenu_menuitem_property_get (mi, APPLICATION_MENUITEM_PROP_ICON);
489 icon = g_icon_new_for_string (str, &error);
490 if (error != NULL)
491 {
492 g_warning ("unable to load icon: %s", error->message);
493 g_error_free (error);
494 }
495 else
496 {
497 gtk_image_set_from_gicon (GTK_IMAGE(w->icon), icon, GTK_ICON_SIZE_MENU);
498 g_object_unref (icon);
499 }
487}500}
488501
489static void502static void
490503
=== modified file 'src/service/app-menu-item.c'
--- src/service/app-menu-item.c 2012-09-17 05:18:18 +0000
+++ src/service/app-menu-item.c 2012-10-03 05:50:26 +0000
@@ -331,6 +331,25 @@
331 {331 {
332 GIcon * icon = g_app_info_get_icon (app_info);332 GIcon * icon = g_app_info_get_icon (app_info);
333 iconstr = g_icon_to_string (icon);333 iconstr = g_icon_to_string (icon);
334
335 /* if GAppInfo returned a themed but non-symbolic icon,
336 let's add the symbolic option here */
337 if (G_IS_THEMED_ICON(icon))
338 {
339 GThemedIcon * themed_icon = G_THEMED_ICON (icon);
340 const gchar * const * names = g_themed_icon_get_names (themed_icon);
341 if (g_strv_length((gchar**)names) == 1)
342 {
343 gchar * tmp = g_strdup_printf ("%s-symbolic", names[0]);
344 g_clear_object (&icon);
345 icon = g_themed_icon_new_with_default_fallbacks (tmp);
346 g_free (tmp);
347 g_free (iconstr);
348 iconstr = g_icon_to_string (icon);
349 }
350 }
351
352 g_clear_object (&icon);
334 }353 }
335354
336 if (iconstr == NULL)355 if (iconstr == NULL)

Subscribers

People subscribed via source and target branches

to all changes: