aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-05 15:04:34 -0500
committerTed Gould <ted@gould.cx>2010-08-05 15:04:34 -0500
commit225167d17161ec59efac14648841b5a36b20f3c1 (patch)
treedf01afe8aab72705bf91f92ba036904118860d23 /src
parent593c6b8c70d347a0109b96e968fc6a4eab7f5fb8 (diff)
downloadlibayatana-appindicator-225167d17161ec59efac14648841b5a36b20f3c1.tar.gz
libayatana-appindicator-225167d17161ec59efac14648841b5a36b20f3c1.tar.bz2
libayatana-appindicator-225167d17161ec59efac14648841b5a36b20f3c1.zip
Tracking the long name along with the application entry.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-application.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c
index 9abfbe6..a3aabb2 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));
}
@@ -693,14 +696,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 = NULL;
+ if (app->longname != NULL) {
+ g_free(app->longname);
+ 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);
}
- indicator_image_helper_update(app->entry.image, longname);
- g_free(longname);
+ indicator_image_helper_update(app->entry.image, app->longname);
return;
}