From 9185eeee48ad6fc91b023127e9f92f7348a0c6aa Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sun, 20 Dec 2009 17:24:13 -0600 Subject: Adding in the icon path to the list of parameters that are passed when we have a new application. --- src/application-service-appstore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/application-service-appstore.c') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 1391d33..92e5668 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -40,6 +40,7 @@ static gboolean _application_service_server_get_applications (ApplicationService #define NOTIFICATION_ITEM_PROP_STATUS "Status" #define NOTIFICATION_ITEM_PROP_ICON_NAME "IconName" #define NOTIFICATION_ITEM_PROP_AICON_NAME "AttentionIconName" +#define NOTIFICATION_ITEM_PROP_ICON_PATH "IconPath" #define NOTIFICATION_ITEM_PROP_MENU "Menu" /* Private Stuff */ @@ -93,8 +94,8 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (ApplicationServiceAppstore, application_added), NULL, NULL, - _application_service_marshal_VOID__STRING_INT_STRING_STRING, - G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); + _application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, + G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -185,6 +186,7 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err 0, /* Position */ app->dbus_name, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)), + g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH)), TRUE); return; -- cgit v1.2.3 From eec24665dda2d3968984141f2d1e07289d10bf79 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 6 Jan 2010 14:27:33 -0600 Subject: Handle the case of no icon path more gracefully, by just passing along the null string. --- src/application-service-appstore.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/application-service-appstore.c') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 92e5668..c9da491 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -180,13 +180,21 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err would involve looking at the name and category and sorting it with the other entries. */ + const gchar * icon_path = NULL; + gpointer icon_path_data = g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH); + if (icon_path_data != NULL) { + icon_path = g_value_get_string((GValue *)icon_path_data); + } else { + icon_path = ""; + } + g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ADDED], 0, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)), 0, /* Position */ app->dbus_name, g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)), - g_value_get_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_PATH)), + icon_path, TRUE); return; -- cgit v1.2.3 From e16d383c5a0fb85742dde81f1f7191fceefa8667 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 7 Jan 2010 00:55:38 -0600 Subject: Forgot to adjust the parameter count. --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/application-service-appstore.c') diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index c9da491..1ac309a 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -95,7 +95,7 @@ application_service_appstore_class_init (ApplicationServiceAppstoreClass *klass) G_STRUCT_OFFSET (ApplicationServiceAppstore, application_added), NULL, NULL, _application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, - G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); + G_TYPE_NONE, 5, G_TYPE_STRING, G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_NONE); signals[APPLICATION_REMOVED] = g_signal_new ("application-removed", G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, -- cgit v1.2.3