diff options
author | Ted Gould <ted@gould.cx> | 2010-08-05 15:07:30 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-05 15:07:30 -0500 |
commit | 141558f12840b45ac376f02689b22e31472d7a6c (patch) | |
tree | 5c9fc30b2d2e3dd0f7522ad4a288f15e57fc26a2 /src | |
parent | 085b99e8a2d33497e4cd8c204baffe71124dca3b (diff) | |
parent | c1aaada70bc0a55e99e1ef7e13e477ddf553f386 (diff) | |
download | libayatana-appindicator-141558f12840b45ac376f02689b22e31472d7a6c.tar.gz libayatana-appindicator-141558f12840b45ac376f02689b22e31472d7a6c.tar.bz2 libayatana-appindicator-141558f12840b45ac376f02689b22e31472d7a6c.zip |
* Upstream Merge
* Adding a helper update of the icon when rebuilding
Diffstat (limited to 'src')
-rw-r--r-- | src/indicator-application.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c index 31c3aa9..eb3de3c 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -89,6 +89,7 @@ struct _ApplicationEntry { gchar * dbusobject; gchar * dbusaddress; gchar * guide; + gchar * longname; }; #define INDICATOR_APPLICATION_GET_PRIVATE(o) \ @@ -511,14 +512,13 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co /* We make a long name using the suffix, and if that icon is available we want to use it. Otherwise we'll just use the name we were given. */ - gchar * longname = NULL; + app->longname = NULL; if (!g_str_has_suffix(iconname, PANEL_ICON_SUFFIX)) { - longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); + app->longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); } else { - longname = g_strdup(iconname); + app->longname = g_strdup(iconname); } - app->entry.image = indicator_image_helper(longname); - g_free(longname); + app->entry.image = indicator_image_helper(app->longname); if (label == NULL || label[0] == '\0') { app->entry.label = NULL; @@ -583,6 +583,9 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a if (app->guide != NULL) { g_free(app->guide); } + if (app->longname != NULL) { + g_free(app->longname); + } if (app->entry.image != NULL) { g_object_unref(G_OBJECT(app->entry.image)); } @@ -668,6 +671,7 @@ application_label_changed (DBusGProxy * proxy, gint position, const gchar * labe } if (app->entry.image != NULL) { + indicator_image_helper_update(app->entry.image, app->longname); gtk_widget_show(GTK_WIDGET(app->entry.image)); } @@ -693,9 +697,16 @@ application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconn /* We make a long name using the suffix, and if that icon is available we want to use it. Otherwise we'll just use the name we were given. */ - gchar * longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); - indicator_image_helper_update(app->entry.image, longname); - g_free(longname); + if (app->longname != NULL) { + g_free(app->longname); + app->longname = NULL; + } + if (!g_str_has_suffix(iconname, PANEL_ICON_SUFFIX)) { + app->longname = g_strdup_printf("%s-%s", iconname, PANEL_ICON_SUFFIX); + } else { + app->longname = g_strdup(iconname); + } + indicator_image_helper_update(app->entry.image, app->longname); return; } |