aboutsummaryrefslogtreecommitdiff
path: root/src/application-service-appstore.c
diff options
context:
space:
mode:
authorSense Egbert Hofstede <sense@ubuntu.com>2010-08-05 15:51:53 +0200
committerSense Egbert Hofstede <sense@ubuntu.com>2010-08-05 15:51:53 +0200
commit247e5a1ac3f714f831bea27fa87170b0ac7fec64 (patch)
tree0d809ef9c73ef069fa7c43f83c202603c8edf80a /src/application-service-appstore.c
parent0a8c09e4f8ce284788845f465dcc826a67602cd0 (diff)
downloadayatana-indicator-application-247e5a1ac3f714f831bea27fa87170b0ac7fec64.tar.gz
ayatana-indicator-application-247e5a1ac3f714f831bea27fa87170b0ac7fec64.tar.bz2
ayatana-indicator-application-247e5a1ac3f714f831bea27fa87170b0ac7fec64.zip
Passing the updated icon theme path along with the DBus signal, saving a DBus call.
Diffstat (limited to 'src/application-service-appstore.c')
-rw-r--r--src/application-service-appstore.c57
1 files changed, 17 insertions, 40 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index c5997e9..f18a89e 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -549,40 +549,6 @@ new_aicon_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdat
return;
}
-/* Gets the data back on an updated icon theme path.
- Maybe a new icon */
-static void
-new_icon_theme_path_cb (DBusGProxy * proxy, GValue value, GError * error, gpointer userdata)
-{
- /* Check for errors */
- if (error != NULL) {
- g_warning("Unable to get updated icon theme path: %s", error->message);
- return;
- }
-
- /* Grab the icon and make sure we have one */
- const gchar * new_icon_theme_path = g_value_get_string(&value);
-
- Application * app = (Application *) userdata;
-
- if (g_strcmp0(new_icon_theme_path, app->icon_theme_path)) {
- /* If the new icon theme path is actually a new icon theme path */
- if (app->icon_theme_path != NULL) g_free(app->icon_theme_path);
- app->icon_theme_path = g_strdup(new_icon_theme_path);
-
- if (app->status == APP_INDICATOR_STATUS_ACTIVE) {
- gint position = get_position(app);
- if (position == -1) return;
-
- g_signal_emit(G_OBJECT(app->appstore),
- signals[APPLICATION_ICON_THEME_PATH_CHANGED], 0,
- position, new_icon_theme_path, TRUE);
- }
- }
-
- return;
-}
-
/* Called when the Notification Item signals that it
has a new icon. */
static void
@@ -632,16 +598,26 @@ new_status (DBusGProxy * proxy, const gchar * status, gpointer data)
/* Called when the Notification Item signals that it
has a new icon theme path. */
static void
-new_icon_theme_path (DBusGProxy * proxy, gpointer data)
+new_icon_theme_path (DBusGProxy * proxy, const gchar * icon_theme_path, gpointer data)
{
Application * app = (Application *)data;
if (!app->validated) return;
- org_freedesktop_DBus_Properties_get_async(app->prop_proxy,
- NOTIFICATION_ITEM_DBUS_IFACE,
- NOTIFICATION_ITEM_PROP_ICON_THEME_PATH,
- new_icon_theme_path_cb,
- app);
+ if (g_strcmp0(icon_theme_path, app->icon_theme_path)) {
+ /* If the new icon theme path is actually a new icon theme path */
+ if (app->icon_theme_path != NULL) g_free(app->icon_theme_path);
+ app->icon_theme_path = g_strdup(icon_theme_path);
+
+ if (app->status == APP_INDICATOR_STATUS_ACTIVE) {
+ gint position = get_position(app);
+ if (position == -1) return;
+
+ g_signal_emit(G_OBJECT(app->appstore),
+ signals[APPLICATION_ICON_THEME_PATH_CHANGED], 0,
+ position, app->icon_theme_path, TRUE);
+ }
+ }
+
return;
}
@@ -720,6 +696,7 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
G_TYPE_INVALID);
dbus_g_proxy_add_signal(app->dbus_proxy,
NOTIFICATION_ITEM_SIG_NEW_ICON_THEME_PATH,
+ G_TYPE_STRING,
G_TYPE_INVALID);
dbus_g_proxy_connect_signal(app->dbus_proxy,