diff options
author | Ted Gould <ted@gould.cx> | 2010-01-07 17:06:38 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-01-07 17:06:38 -0600 |
commit | b1ffef34b05cecbad73a0278dcfe67b4c3a22f90 (patch) | |
tree | d2ab38c259eef60f4d26c6a342f83e0af38904c3 /src/indicator-application.c | |
parent | 2cc15ba2a7ce9f141068ee8e348906bfd867f9f5 (diff) | |
parent | ad8ca0d507d627da2221d39cd45c78e760623598 (diff) | |
download | ayatana-indicator-application-b1ffef34b05cecbad73a0278dcfe67b4c3a22f90.tar.gz ayatana-indicator-application-b1ffef34b05cecbad73a0278dcfe67b4c3a22f90.tar.bz2 ayatana-indicator-application-b1ffef34b05cecbad73a0278dcfe67b4c3a22f90.zip |
Merging in the icon_path branch to start to handle conflicts from there.
Diffstat (limited to 'src/indicator-application.c')
-rw-r--r-- | src/indicator-application.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/indicator-application.c b/src/indicator-application.c index 221be04..c330645 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -80,6 +80,7 @@ struct _IndicatorApplicationPrivate { typedef struct _ApplicationEntry ApplicationEntry; struct _ApplicationEntry { IndicatorObjectEntry entry; + gchar * icon_path; }; #define INDICATOR_APPLICATION_GET_PRIVATE(o) \ @@ -91,7 +92,7 @@ static void indicator_application_dispose (GObject *object); static void indicator_application_finalize (GObject *object); static GList * get_entries (IndicatorObject * io); static void connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplication * application); -static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, IndicatorApplication * application); +static void application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); static void application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconname, IndicatorApplication * application); static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata); @@ -112,12 +113,13 @@ indicator_application_class_init (IndicatorApplicationClass *klass) io_class->get_entries = get_entries; - dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING, + dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); dbus_g_object_register_marshaller(_application_service_marshal_VOID__INT_STRING, G_TYPE_NONE, @@ -217,6 +219,7 @@ connected (IndicatorServiceManager * sm, gboolean connected, IndicatorApplicatio G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_STRING, G_TYPE_INVALID); dbus_g_proxy_add_signal(priv->service_proxy, "ApplicationRemoved", @@ -283,12 +286,19 @@ get_entries (IndicatorObject * io) ApplicationEntry and signaling the indicator host that we've got a new indicator. */ static void -application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, IndicatorApplication * application) +application_added (DBusGProxy * proxy, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_path, IndicatorApplication * application) { g_debug("Building new application entry: %s with icon: %s", dbusaddress, iconname); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); ApplicationEntry * app = g_new(ApplicationEntry, 1); + app->icon_path = NULL; + if (icon_path != NULL && icon_path[0] != '\0') { + app->icon_path = g_strdup(icon_path); + g_debug("\tAppending search path: %s", app->icon_path); + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), app->icon_path); + } + app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(iconname, GTK_ICON_SIZE_MENU)); app->entry.label = NULL; app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject)); @@ -318,6 +328,9 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a priv->applications = g_list_remove(priv->applications, app); g_signal_emit(G_OBJECT(application), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, &(app->entry), TRUE); + if (app->icon_path != NULL) { + g_free(app->icon_path); + } if (app->entry.image != NULL) { g_object_unref(G_OBJECT(app->entry.image)); } |