From 9393ffcfed126137fd9341a3dc3de91c9699ca1f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 13:58:15 -0600 Subject: Adding in our hash table of refs. --- src/indicator-application.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index c330645..3800a03 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -75,6 +75,7 @@ struct _IndicatorApplicationPrivate { DBusGConnection * bus; DBusGProxy * service_proxy; GList * applications; + GHashTable * theme_dirs; }; typedef struct _ApplicationEntry ApplicationEntry; @@ -96,6 +97,8 @@ static void application_added (DBusGProxy * proxy, const gchar * iconname, gint 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); +static void theme_dir_unref(IndicatorApplication * ia, const gchar * dir); +static void theme_dir_ref(IndicatorApplication * ia, const gchar * dir); G_DEFINE_TYPE (IndicatorApplication, indicator_application, INDICATOR_OBJECT_TYPE); @@ -138,12 +141,15 @@ indicator_application_init (IndicatorApplication *self) /* These are built in the connection phase */ priv->bus = NULL; priv->service_proxy = NULL; + priv->theme_dirs = NULL; priv->sm = indicator_service_manager_new(INDICATOR_APPLICATION_DBUS_ADDR); g_signal_connect(G_OBJECT(priv->sm), INDICATOR_SERVICE_MANAGER_SIGNAL_CONNECTION_CHANGE, G_CALLBACK(connected), self); priv->applications = NULL; + priv->theme_dirs = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); + return; } @@ -173,6 +179,15 @@ indicator_application_dispose (GObject *object) priv->service_proxy = NULL; } + if (priv->theme_dirs != NULL) { + while (g_hash_table_size(priv->theme_dirs)) { + GList * keys = g_hash_table_get_keys(priv->theme_dirs); + theme_dir_unref(INDICATOR_APPLICATION(object), (gchar *)keys->data); + } + g_hash_table_destroy(priv->theme_dirs); + priv->theme_dirs = NULL; + } + G_OBJECT_CLASS (indicator_application_parent_class)->dispose (object); return; } @@ -297,6 +312,7 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co 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); + theme_dir_ref(application, icon_path); } app->entry.image = GTK_IMAGE(gtk_image_new_from_icon_name(iconname, GTK_ICON_SIZE_MENU)); @@ -371,3 +387,22 @@ get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, return; } + +/* Refs a theme directory, and it may add it to the search + path */ +static void +theme_dir_unref(IndicatorApplication * ia, const gchar * dir) +{ + + +} + +/* Unrefs a theme directory. This may involve removing it from + the search path. */ +static void +theme_dir_ref(IndicatorApplication * ia, const gchar * dir) +{ + + +} + -- cgit v1.2.3 From 37127332ec8e359f7c3867da5bb39f993c97afc6 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 14:25:22 -0600 Subject: Fleshing out the ref and the unref functions for the theme directories. --- src/indicator-application.c | 69 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 2 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index 3800a03..70d16c2 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -310,8 +310,6 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co 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); theme_dir_ref(application, icon_path); } @@ -393,8 +391,59 @@ get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, static void theme_dir_unref(IndicatorApplication * ia, const gchar * dir) { + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(ia); + /* Grab the count for this dir */ + int count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir)); + /* Is this a simple deprecation, if so, we can just lower the + number and move on. */ + if (count > 1) { + count--; + g_hash_table_insert(priv->theme_dirs, g_strdup(dir), GINT_TO_POINTER(count)); + return; + } + + /* Try to remove it from the hash table, this makes sure + that it existed */ + if (!g_hash_table_remove(priv->theme_dirs, dir)) { + g_warning("Unref'd a directory that wasn't in the theme dir hash table."); + return; + } + + GtkIconTheme * icon_theme = gtk_icon_theme_get_default(); + gchar ** paths; + gint path_count; + + gtk_icon_theme_get_search_path(icon_theme, &paths, &path_count); + + gint i; + gboolean found = FALSE; + for (i = 0; i < path_count; i++) { + if (found) { + /* If we've already found the right entry */ + paths[i - 1] = paths[i]; + } else { + /* We're still looking, is this the one? */ + if (!g_strcmp0(paths[i], dir)) { + found = TRUE; + /* We're freeing this here as it won't be captured by the + g_strfreev() below as it's out of the array. */ + g_free(paths[i]); + } + } + } + + /* If we found one we need to reset the path to + accomidate the changes */ + if (found) { + paths[path_count - 1] = NULL; /* Clear the last one */ + gtk_icon_theme_set_search_path(icon_theme, (const gchar **)paths, path_count - 1); + } + + g_strfreev(paths); + + return; } /* Unrefs a theme directory. This may involve removing it from @@ -402,7 +451,23 @@ theme_dir_unref(IndicatorApplication * ia, const gchar * dir) static void theme_dir_ref(IndicatorApplication * ia, const gchar * dir) { + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(ia); + g_debug("\tAppending search path: %s", dir); + + int count = 0; + if ((count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir))) == 0) { + /* It exists so what we need to do is increase the ref + count of this dir. */ + count++; + } else { + /* It doesn't exist, so we need to add it to the table + and to the search path. */ + gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), dir); + count = 1; + } + g_hash_table_insert(priv->theme_dirs, g_strdup(dir), GINT_TO_POINTER(count)); + return; } -- cgit v1.2.3 From fe7f3dcf1257a4cba7375439ae50c250abb39a56 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 15:14:12 -0600 Subject: We should have kept ref's to these. --- src/indicator-application.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index c330645..8e88f8e 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -303,6 +303,10 @@ application_added (DBusGProxy * proxy, const gchar * iconname, gint position, co app->entry.label = NULL; app->entry.menu = GTK_MENU(dbusmenu_gtkmenu_new((gchar *)dbusaddress, (gchar *)dbusobject)); + /* Keep copies of these for ourself, just in case. */ + g_object_ref(app->entry.image); + g_object_ref(app->entry.menu); + gtk_widget_show(GTK_WIDGET(app->entry.image)); priv->applications = g_list_insert(priv->applications, app, position); -- cgit v1.2.3 From 5a93b5e7a2d9f805756bdaa89d5a01f649f60da3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 15:16:37 -0600 Subject: Debug message for directories. --- src/indicator-application.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index 70d16c2..72d3d0d 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -420,6 +420,7 @@ theme_dir_unref(IndicatorApplication * ia, const gchar * dir) gint i; gboolean found = FALSE; for (i = 0; i < path_count; i++) { + g_debug("Looking at path dir: '%s'", paths[i]); if (found) { /* If we've already found the right entry */ paths[i - 1] = paths[i]; -- cgit v1.2.3 From 76ef80de4f8f51d2907c24730387230f06d3fd63 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 15:40:49 -0600 Subject: Actually unref'ing the dir and fixing the truth there. --- src/indicator-application.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index d697d96..06159f9 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -347,6 +347,7 @@ application_removed (DBusGProxy * proxy, gint position, IndicatorApplication * a g_signal_emit(G_OBJECT(application), INDICATOR_OBJECT_SIGNAL_ENTRY_REMOVED_ID, 0, &(app->entry), TRUE); if (app->icon_path != NULL) { + theme_dir_unref(application, app->icon_path); g_free(app->icon_path); } if (app->entry.image != NULL) { @@ -457,10 +458,9 @@ static void theme_dir_ref(IndicatorApplication * ia, const gchar * dir) { IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(ia); - g_debug("\tAppending search path: %s", dir); int count = 0; - if ((count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir))) == 0) { + if ((count = GPOINTER_TO_INT(g_hash_table_lookup(priv->theme_dirs, dir))) != 0) { /* It exists so what we need to do is increase the ref count of this dir. */ count++; @@ -468,6 +468,7 @@ theme_dir_ref(IndicatorApplication * ia, const gchar * dir) /* It doesn't exist, so we need to add it to the table and to the search path. */ gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), dir); + g_debug("\tAppending search path: %s", dir); count = 1; } -- cgit v1.2.3 From 831a83ce1adefbf5a713133ea44611ad857038e7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 15:41:16 -0600 Subject: Removing shutdown printf --- src/indicator-application.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index 06159f9..ecaa7ae 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -425,7 +425,6 @@ theme_dir_unref(IndicatorApplication * ia, const gchar * dir) gint i; gboolean found = FALSE; for (i = 0; i < path_count; i++) { - g_debug("Looking at path dir: '%s'", paths[i]); if (found) { /* If we've already found the right entry */ paths[i - 1] = paths[i]; -- cgit v1.2.3 From 7a001c72db8fcbd518c132862ddc215bc215aac4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 23:22:46 -0600 Subject: Fleshing out returning the list of apps already there. --- src/application-service-appstore.c | 47 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index fa1b9d2..282eb51 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -31,7 +31,7 @@ with this program. If not, see . #include "dbus-shared.h" /* DBus Prototypes */ -static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GArray ** apps); +static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps); #include "application-service-server.h" @@ -624,8 +624,51 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap /* DBus Interface */ static gboolean -_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GArray ** apps) +_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps) { + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + + *apps = g_ptr_array_new(); + GList * listpntr; + gint position = 0; + + for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) { + GValueArray * values = g_value_array_new(0); + + GValue value = {0}; + + /* Icon name */ + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, ((Application *)listpntr->data)->icon); + g_value_array_append(values, &value); + g_value_unset(&value); + + /* Position */ + g_value_init(&value, G_TYPE_INT); + g_value_set_int(&value, position++); + g_value_array_append(values, &value); + g_value_unset(&value); + + /* DBus Address */ + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, ((Application *)listpntr->data)->dbus_name); + g_value_array_append(values, &value); + g_value_unset(&value); + + /* DBus Object */ + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, ((Application *)listpntr->data)->dbus_object); + g_value_array_append(values, &value); + g_value_unset(&value); + + /* Icon path */ + g_value_init(&value, G_TYPE_STRING); + g_value_set_string(&value, ((Application *)listpntr->data)->icon_path); + g_value_array_append(values, &value); + g_value_unset(&value); + + g_ptr_array_add(*apps, values); + } return FALSE; } -- cgit v1.2.3 From 321ae86c9366714e74ec70923e52facce29ca0b1 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 23:25:34 -0600 Subject: Need icon path in the list as well. --- src/application-service.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service.xml b/src/application-service.xml index d74aaa9..0b2e959 100644 --- a/src/application-service.xml +++ b/src/application-service.xml @@ -26,7 +26,7 @@ with this program. If not, see . - + -- cgit v1.2.3 From eddc0d0e435a16acacafe086475ef79cc3f599ae Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 14 Jan 2010 23:30:11 -0600 Subject: Returning truth. --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 282eb51..d70e2f8 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -670,6 +670,6 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst g_ptr_array_add(*apps, values); } - return FALSE; + return TRUE; } -- cgit v1.2.3 From 00cad2ec8d5a143b3970dd63825cbd4b6265092a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 00:48:09 -0600 Subject: Better init value and adding error to prototype. --- src/application-service-appstore.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index d70e2f8..95f8dde 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -31,7 +31,7 @@ with this program. If not, see . #include "dbus-shared.h" /* DBus Prototypes */ -static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps); +static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error); #include "application-service-server.h" @@ -624,7 +624,7 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap /* DBus Interface */ static gboolean -_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps) +_application_service_server_get_applications (ApplicationServiceAppstore * appstore, GPtrArray ** apps, GError ** error) { ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); @@ -633,7 +633,7 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst gint position = 0; for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) { - GValueArray * values = g_value_array_new(0); + GValueArray * values = g_value_array_new(5); GValue value = {0}; -- cgit v1.2.3 From 8045abdf6b0390572dbeb1a224431ec4c3e3355e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 01:01:11 -0600 Subject: Setting the proper type for the GValue of an 'o' --- src/application-service-appstore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 95f8dde..df4213a 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -656,8 +656,8 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst g_value_unset(&value); /* DBus Object */ - g_value_init(&value, G_TYPE_STRING); - g_value_set_string(&value, ((Application *)listpntr->data)->dbus_object); + g_value_init(&value, DBUS_TYPE_G_OBJECT_PATH); + g_value_set_static_boxed(&value, ((Application *)listpntr->data)->dbus_object); g_value_array_append(values, &value); g_value_unset(&value); -- cgit v1.2.3 From b447c26d5dab577f46ad32d6191bc623be9aaf25 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 08:51:02 -0600 Subject: Fleshing out the get_applications function so that we do something with the list we now get. --- src/indicator-application.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index c330645..c6b962a 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -96,6 +96,7 @@ static void application_added (DBusGProxy * proxy, const gchar * iconname, gint 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); +static void get_applications_helper (gpointer data, gpointer user_data); G_DEFINE_TYPE (IndicatorApplication, indicator_application, INDICATOR_OBJECT_TYPE); @@ -368,6 +369,42 @@ application_icon_changed (DBusGProxy * proxy, gint position, const gchar * iconn static void get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, gpointer userdata) { + if (error != NULL) { + g_warning("Unable to get application list: %s", error->message); + return; + } + g_ptr_array_foreach(OUT_applications, get_applications_helper, proxy); return; } + +/* A little helper that takes apart the DBus structure and calls + application_added on every entry in the list. */ +static void +get_applications_helper (gpointer data, gpointer user_data) +{ + GType structype = dbus_g_type_get_struct("GValueArray", + G_TYPE_STRING, + G_TYPE_INT, + G_TYPE_STRING, + DBUS_TYPE_G_OBJECT_PATH, + G_TYPE_STRING, + G_TYPE_INVALID); + g_return_if_fail(G_VALUE_HOLDS(data, structype)); + + gchar * icon_name; + gint position; + gchar * dbus_address; + gchar * dbus_object; + gchar * icon_path; + + dbus_g_type_struct_get(data, + 0, &icon_name, + 1, &position, + 2, &dbus_address, + 3, &dbus_object, + 4, &icon_path, + G_MAXUINT); + + return application_added(user_data, icon_name, position, dbus_address, dbus_object, icon_path, NULL); +} -- cgit v1.2.3 From 2579e9f10454dc36c6b793fd064936737052d577 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 10:04:24 -0600 Subject: Using a straight value array and making sure to pass the application --- src/indicator-application.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index c6b962a..fc7f56d 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -373,7 +373,7 @@ get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, g_warning("Unable to get application list: %s", error->message); return; } - g_ptr_array_foreach(OUT_applications, get_applications_helper, proxy); + g_ptr_array_foreach(OUT_applications, get_applications_helper, userdata); return; } @@ -383,6 +383,7 @@ get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, static void get_applications_helper (gpointer data, gpointer user_data) { +#if 0 GType structype = dbus_g_type_get_struct("GValueArray", G_TYPE_STRING, G_TYPE_INT, @@ -390,21 +391,16 @@ get_applications_helper (gpointer data, gpointer user_data) DBUS_TYPE_G_OBJECT_PATH, G_TYPE_STRING, G_TYPE_INVALID); - g_return_if_fail(G_VALUE_HOLDS(data, structype)); +#endif + GValueArray * array = (GValueArray *)data; - gchar * icon_name; - gint position; - gchar * dbus_address; - gchar * dbus_object; - gchar * icon_path; + g_debug("Size: %d", array->n_values); - dbus_g_type_struct_get(data, - 0, &icon_name, - 1, &position, - 2, &dbus_address, - 3, &dbus_object, - 4, &icon_path, - G_MAXUINT); + const gchar * icon_name = g_value_get_string(g_value_array_get_nth(array, 0)); + gint position = g_value_get_int(g_value_array_get_nth(array, 1)); + const gchar * dbus_address = g_value_get_string(g_value_array_get_nth(array, 2)); + const gchar * dbus_object = g_value_get_boxed(g_value_array_get_nth(array, 3)); + const gchar * icon_path = g_value_get_string(g_value_array_get_nth(array, 4)); - return application_added(user_data, icon_name, position, dbus_address, dbus_object, icon_path, NULL); + return application_added(NULL, icon_name, position, dbus_address, dbus_object, icon_path, user_data); } -- cgit v1.2.3 From 93f32fd90d78997bf9661ddeaa8bfbb2f3020ced Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 10:05:21 -0600 Subject: Using the menu path instead of the item path. --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index df4213a..bc99855 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -657,7 +657,7 @@ _application_service_server_get_applications (ApplicationServiceAppstore * appst /* DBus Object */ g_value_init(&value, DBUS_TYPE_G_OBJECT_PATH); - g_value_set_static_boxed(&value, ((Application *)listpntr->data)->dbus_object); + g_value_set_static_boxed(&value, ((Application *)listpntr->data)->menu); g_value_array_append(values, &value); g_value_unset(&value); -- cgit v1.2.3 From 9c545b7e13a3c0926d569775cfe5ff470874f675 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 10:14:31 -0600 Subject: Cleaning out dead code and turning a printout into an assert. --- src/indicator-application.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index fc7f56d..c8f3024 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -383,18 +383,9 @@ get_applications (DBusGProxy *proxy, GPtrArray *OUT_applications, GError *error, static void get_applications_helper (gpointer data, gpointer user_data) { -#if 0 - GType structype = dbus_g_type_get_struct("GValueArray", - G_TYPE_STRING, - G_TYPE_INT, - G_TYPE_STRING, - DBUS_TYPE_G_OBJECT_PATH, - G_TYPE_STRING, - G_TYPE_INVALID); -#endif GValueArray * array = (GValueArray *)data; - g_debug("Size: %d", array->n_values); + g_return_if_fail(array->n_values == 5); const gchar * icon_name = g_value_get_string(g_value_array_get_nth(array, 0)); gint position = g_value_get_int(g_value_array_get_nth(array, 1)); -- cgit v1.2.3 From 3344b7dec5ac6839aa2189c030da42e15ee1995e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 13:38:00 -0600 Subject: Changing to use the status wrapper for handling the status signal's different prototype. --- src/libappindicator/app-indicator.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 6c969c2..5e7fee4 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -754,7 +754,7 @@ fallback (AppIndicator * self) gtk_status_icon_set_title(icon, app_indicator_get_id(self)); g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_STATUS, - G_CALLBACK(status_icon_changes), icon); + G_CALLBACK(status_icon_status_wrapper), icon); g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_ICON, G_CALLBACK(status_icon_changes), icon); g_signal_connect(G_OBJECT(self), APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON, -- cgit v1.2.3 -- cgit v1.2.3