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 abd499aaeb280ef2ab24f4e392484ecd4d8bb7a2 Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Thu, 14 Jan 2010 20:27:28 -0600 Subject: Only add the Application if it doesn't already exist in the appstore. --- src/application-service-appstore.c | 12 ++++++++++-- src/libappindicator/app-indicator.c | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index fa1b9d2..c896beb 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -333,8 +333,6 @@ apply_status (Application * app, ApplicationStatus status) g_signal_emit(G_OBJECT(appstore), signals[APPLICATION_REMOVED], 0, position, TRUE); - - priv->applications = g_list_remove(priv->applications, app); } else { /* Figure out which icon we should be using */ gchar * newicon = app->icon; @@ -511,6 +509,16 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0'); ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + GList *l = NULL; + for (l = priv->applications; l != NULL; l = g_list_next (l)) { + Application *tmp_app = (Application *)l->data; + + if (g_strcmp0 (tmp_app->dbus_name, dbus_name) == 0 && + g_strcmp0 (tmp_app->dbus_object, dbus_object) == 0) { + return; + } + } + /* Build the application entry. This will be carried along until we're sure we've got everything. */ Application * app = g_new0(Application, 1); diff --git a/src/libappindicator/app-indicator.c b/src/libappindicator/app-indicator.c index 6c969c2..7fabef9 100644 --- a/src/libappindicator/app-indicator.c +++ b/src/libappindicator/app-indicator.c @@ -370,6 +370,10 @@ app_indicator_dispose (GObject *object) priv->menu = NULL; } + if (priv->menuservice != NULL) { + g_object_unref (priv->menuservice); + } + if (priv->dbus_proxy != NULL) { g_object_unref(G_OBJECT(priv->dbus_proxy)); priv->dbus_proxy = NULL; -- 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 36e7fd1e45ad3f3eb89c6a7ea0b9b92b754b3971 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 08:56:49 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa2~applist1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 8c58286..8b0e033 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.9-0ubuntu1~ppa2~applist1) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa2~applist1) karmic; urgency=low * Upstream update * Support getting the app list from a running service. - -- Ted Gould Fri, 15 Jan 2010 08:53:46 -0600 + -- Ted Gould Fri, 15 Jan 2010 08:56:47 -0600 indicator-application (0.0.9-0ubuntu1~ppa1) karmic; urgency=low -- 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 fd7d6e6bebe1233ecf2cfba9e8bd69bee6b1a133 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 15 Jan 2010 10:09:00 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa2~applist2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7c3526a..4441648 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.9-0ubuntu1~ppa2~applist2) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa2~applist2) karmic; urgency=low * Upstream update * Simplify and correct the structure handling. * Pass the correct object path over the bus. We want the menu. - -- Ted Gould Fri, 15 Jan 2010 10:06:28 -0600 + -- Ted Gould Fri, 15 Jan 2010 10:08:58 -0600 indicator-application (0.0.9-0ubuntu1~ppa2~applist1) karmic; urgency=low -- 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 f8d65da606cc460ebac5f273b754e8885dc91433 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 10:42:11 -0600 Subject: Adding an object to start tracking the lru of the app indicators --- src/Makefile.am | 2 ++ src/application-service-lru-file.c | 56 ++++++++++++++++++++++++++++++++++++++ src/application-service-lru-file.h | 33 ++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 src/application-service-lru-file.c create mode 100644 src/application-service-lru-file.h diff --git a/src/Makefile.am b/src/Makefile.am index d9b7963..38e6dd9 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -35,6 +35,8 @@ indicator_application_service_SOURCES = \ application-service.c \ application-service-appstore.h \ application-service-appstore.c \ + application-service-lru-file.h \ + application-service-lru-file.c \ application-service-marshal.h \ application-service-marshal.c \ application-service-server.h \ diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c new file mode 100644 index 0000000..3cbb1dc --- /dev/null +++ b/src/application-service-lru-file.c @@ -0,0 +1,56 @@ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "application-service-lru-file.h" + +typedef struct _AppLruFilePrivate AppLruFilePrivate; +struct _AppLruFilePrivate { + gint temp; +}; + +#define APP_LRU_FILE_GET_PRIVATE(o) \ + (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_LRU_FILE_TYPE, AppLruFilePrivate)) + +static void app_lru_file_class_init (AppLruFileClass *klass); +static void app_lru_file_init (AppLruFile *self); +static void app_lru_file_dispose (GObject *object); +static void app_lru_file_finalize (GObject *object); + +G_DEFINE_TYPE (AppLruFile, app_lru_file, G_TYPE_OBJECT); + +static void +app_lru_file_class_init (AppLruFileClass *klass) +{ + GObjectClass *object_class = G_OBJECT_CLASS (klass); + + g_type_class_add_private (klass, sizeof (AppLruFilePrivate)); + + object_class->dispose = app_lru_file_dispose; + object_class->finalize = app_lru_file_finalize; + + return; +} + +static void +app_lru_file_init (AppLruFile *self) +{ + + return; +} + +static void +app_lru_file_dispose (GObject *object) +{ + + G_OBJECT_CLASS (app_lru_file_parent_class)->dispose (object); + return; +} + +static void +app_lru_file_finalize (GObject *object) +{ + + G_OBJECT_CLASS (app_lru_file_parent_class)->finalize (object); + return; +} diff --git a/src/application-service-lru-file.h b/src/application-service-lru-file.h new file mode 100644 index 0000000..6577278 --- /dev/null +++ b/src/application-service-lru-file.h @@ -0,0 +1,33 @@ +#ifndef __APP_LRU_FILE_H__ +#define __APP_LRU_FILE_H__ + +#include +#include + +G_BEGIN_DECLS + +#define APP_LRU_FILE_TYPE (app_lru_file_get_type ()) +#define APP_LRU_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), APP_LRU_FILE_TYPE, AppLruFile)) +#define APP_LRU_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), APP_LRU_FILE_TYPE, AppLruFileClass)) +#define IS_APP_LRU_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), APP_LRU_FILE_TYPE)) +#define IS_APP_LRU_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), APP_LRU_FILE_TYPE)) +#define APP_LRU_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), APP_LRU_FILE_TYPE, AppLruFileClass)) + +typedef struct _AppLruFile AppLruFile; +typedef struct _AppLruFileClass AppLruFileClass; + +struct _AppLruFileClass { + GObjectClass parent_class; + +}; + +struct _AppLruFile { + GObject parent; + +}; + +GType app_lru_file_get_type (void); + +G_END_DECLS + +#endif -- cgit v1.2.3 From e9fafdfa046eda4da67357ebfc02f48159403f8d Mon Sep 17 00:00:00 2001 From: Cody Russell Date: Tue, 19 Jan 2010 11:28:33 -0600 Subject: Move the check for duplicates. --- src/application-service-appstore.c | 65 +++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 25 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index c896beb..d0b5570 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -311,6 +311,28 @@ application_removed_cb (DBusGProxy * proxy, gpointer userdata) return; } +static gboolean +can_add_application (GList *applications, Application *app) +{ + if (applications) + { + GList *l = NULL; + + for (l = applications; l != NULL; l = g_list_next (l)) + { + Application *tmp_app = (Application *)l->data; + + if (g_strcmp0 (tmp_app->dbus_name, app->dbus_name) == 0 && + g_strcmp0 (tmp_app->dbus_object, app->dbus_object) == 0) + { + return FALSE; + } + } + } + + return TRUE; +} + /* Change the status of the application. If we're going passive it removes it from the panel. If we're coming online, then it add it to the panel. Otherwise it changes the icon. */ @@ -333,6 +355,7 @@ apply_status (Application * app, ApplicationStatus status) g_signal_emit(G_OBJECT(appstore), signals[APPLICATION_REMOVED], 0, position, TRUE); + priv->applications = g_list_remove(priv->applications, app); } else { /* Figure out which icon we should be using */ gchar * newicon = app->icon; @@ -342,21 +365,23 @@ apply_status (Application * app, ApplicationStatus status) /* Determine whether we're already shown or not */ if (app->status == APP_STATUS_PASSIVE) { - /* Put on panel */ - priv->applications = g_list_prepend(priv->applications, app); - - /* TODO: We need to have the position determined better. This - would involve looking at the name and category and sorting - it with the other entries. */ - - g_signal_emit(G_OBJECT(app->appstore), - signals[APPLICATION_ADDED], 0, - newicon, - 0, /* Position */ - app->dbus_name, - app->menu, - app->icon_path, - TRUE); + if (can_add_application (priv->applications, app)) { + /* Put on panel */ + priv->applications = g_list_prepend (priv->applications, app); + + /* TODO: We need to have the position determined better. This + would involve looking at the name and category and sorting + it with the other entries. */ + + g_signal_emit(G_OBJECT(app->appstore), + signals[APPLICATION_ADDED], 0, + newicon, + 0, /* Position */ + app->dbus_name, + app->menu, + app->icon_path, + TRUE); + } } else { /* Icon update */ gint position = get_position(app); @@ -509,16 +534,6 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0'); ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); - GList *l = NULL; - for (l = priv->applications; l != NULL; l = g_list_next (l)) { - Application *tmp_app = (Application *)l->data; - - if (g_strcmp0 (tmp_app->dbus_name, dbus_name) == 0 && - g_strcmp0 (tmp_app->dbus_object, dbus_object) == 0) { - return; - } - } - /* Build the application entry. This will be carried along until we're sure we've got everything. */ Application * app = g_new0(Application, 1); -- cgit v1.2.3 From 2f82ed57b751145449506164888281b57819abcc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 17:01:57 -0600 Subject: Adding some API to our LRU file --- src/application-service-lru-file.c | 33 +++++++++++++++++++++++++++++++++ src/application-service-lru-file.h | 4 ++++ 2 files changed, 37 insertions(+) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index 3cbb1dc..47cfab9 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -54,3 +54,36 @@ app_lru_file_finalize (GObject *object) G_OBJECT_CLASS (app_lru_file_parent_class)->finalize (object); return; } + +/* API */ + +/* Simple helper to create a new object */ +AppLruFile * +app_lru_file_new (void) +{ + return APP_LRU_FILE(g_object_new(APP_LRU_FILE_TYPE, NULL)); +} + +/* This updates the timestamp for a particular + entry in the database. It also queues up a + write out of the database. But that'll happen + later. */ +void +app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * category) +{ + g_return_if_fail(IS_APP_LRU_FILE(lrufile)); + g_return_if_fail(id != NULL && id[0] != '\0'); + g_return_if_fail(category != NULL && category[0] != '\0'); + + return; +} + +/* Used to sort or compare different applications. */ +gint +app_lru_file_sort (AppLruFile * lrufile, const gchar * id_a, const gchar * id_b) +{ + g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), -1); + + + return 0; +} diff --git a/src/application-service-lru-file.h b/src/application-service-lru-file.h index 6577278..45d3082 100644 --- a/src/application-service-lru-file.h +++ b/src/application-service-lru-file.h @@ -28,6 +28,10 @@ struct _AppLruFile { GType app_lru_file_get_type (void); +AppLruFile * app_lru_file_new (void); +void app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * category); +gint app_lru_file_sort (AppLruFile * lrufile, const gchar * id_a, const gchar * id_b); + G_END_DECLS #endif -- cgit v1.2.3 From 85394de1aa25fea66bbe30e3ceeafc754f2e8ff7 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 17:04:20 -0600 Subject: Building the LRU file. --- src/application-service.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/application-service.c b/src/application-service.c index 351e9aa..abb86ee 100644 --- a/src/application-service.c +++ b/src/application-service.c @@ -25,6 +25,7 @@ with this program. If not, see . #include "notification-item-client.h" #include "application-service-appstore.h" #include "application-service-watcher.h" +#include "application-service-lru-file.h" #include "dbus-shared.h" /* The base main loop */ @@ -35,6 +36,8 @@ static ApplicationServiceAppstore * appstore = NULL; static ApplicationServiceWatcher * watcher = NULL; /* The service management interface */ static IndicatorService * service = NULL; +/* The LRU file interface */ +static AppLruFile * lrufile = NULL; /* Recieves the disonnection signal from the service object and closes the mainloop. */ @@ -59,6 +62,9 @@ main (int argc, char ** argv) service = indicator_service_new(INDICATOR_APPLICATION_DBUS_ADDR); g_signal_connect(G_OBJECT(service), INDICATOR_SERVICE_SIGNAL_SHUTDOWN, G_CALLBACK(service_disconnected), NULL); + /* Start up the LRU file reading */ + lrufile = app_lru_file_new(); + /* Building our app store */ appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); -- cgit v1.2.3 From 08fef8dc585407e88d27da07a7c6fd726303a0dd Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 17:20:21 -0600 Subject: Adding a _new function for the appstore and using it. It now takes the lru file. --- src/application-service-appstore.c | 13 +++++++++++++ src/application-service-appstore.h | 2 ++ src/application-service.c | 3 ++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index d0b5570..2121a0d 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -52,6 +52,7 @@ typedef struct _ApplicationServiceAppstorePrivate ApplicationServiceAppstorePriv struct _ApplicationServiceAppstorePrivate { DBusGConnection * bus; GList * applications; + AppLruFile * lrufile; }; #define APP_STATUS_PASSIVE_STR "passive" @@ -148,6 +149,7 @@ application_service_appstore_init (ApplicationServiceAppstore *self) ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(self); priv->applications = NULL; + priv->lrufile = NULL; GError * error = NULL; priv->bus = dbus_g_bus_get(DBUS_BUS_STARTER, &error); @@ -645,6 +647,17 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap return; } +/* Creates a basic appstore object and attaches the + LRU file object to it. */ +ApplicationServiceAppstore * +application_service_appstore_new (AppLruFile * lrufile) +{ + ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); + priv->lrufile = lrufile; + return appstore; +} + /* DBus Interface */ static gboolean _application_service_server_get_applications (ApplicationServiceAppstore * appstore, GArray ** apps) diff --git a/src/application-service-appstore.h b/src/application-service-appstore.h index 6bd7a01..d2e0013 100644 --- a/src/application-service-appstore.h +++ b/src/application-service-appstore.h @@ -25,6 +25,7 @@ with this program. If not, see . #include #include +#include "application-service-lru-file.h" G_BEGIN_DECLS @@ -50,6 +51,7 @@ struct _ApplicationServiceAppstore { GObject parent; }; +ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile); GType application_service_appstore_get_type (void); void application_service_appstore_application_add (ApplicationServiceAppstore * appstore, const gchar * dbus_name, diff --git a/src/application-service.c b/src/application-service.c index abb86ee..ffd042e 100644 --- a/src/application-service.c +++ b/src/application-service.c @@ -66,7 +66,7 @@ main (int argc, char ** argv) lrufile = app_lru_file_new(); /* Building our app store */ - appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); + appstore = application_service_appstore_new(lrufile); /* Adding a watcher for the Apps coming up */ watcher = application_service_watcher_new(appstore); @@ -79,6 +79,7 @@ main (int argc, char ** argv) g_object_unref(G_OBJECT(watcher)); g_object_unref(G_OBJECT(appstore)); g_object_unref(G_OBJECT(service)); + g_object_unref(G_OBJECT(lrufile)); return 0; } -- cgit v1.2.3 From e8d460427dd2147f2d8e7f4d648f4a49a3afaed3 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 17:21:22 -0600 Subject: Protecting our _new a little bit. --- src/application-service-appstore.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 2121a0d..e734bdd 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -652,6 +652,7 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap ApplicationServiceAppstore * application_service_appstore_new (AppLruFile * lrufile) { + g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), NULL); ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(g_object_new(APPLICATION_SERVICE_APPSTORE_TYPE, NULL)); ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore); priv->lrufile = lrufile; -- cgit v1.2.3 From 570fc9486cb9f0a442ce0989c2bff1bc7942e67f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 20:44:23 -0600 Subject: Adding in the 'id' and 'category' fields to the application structure. --- src/application-service-appstore.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index e734bdd..7d925d2 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -68,6 +68,8 @@ enum _ApplicationStatus { typedef struct _Application Application; struct _Application { + gchar * id; + gchar * category; gchar * dbus_name; gchar * dbus_object; ApplicationServiceAppstore * appstore; /* not ref'd */ @@ -203,6 +205,8 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err Application * app = (Application *)data; if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU) == NULL || + g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ID) == NULL || + g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_CATEGORY) == NULL || g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_STATUS) == NULL || g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME) == NULL) { g_warning("Notification Item on object %s of %s doesn't have enough properties.", app->dbus_object, app->dbus_name); @@ -212,6 +216,11 @@ get_all_properties_cb (DBusGProxy * proxy, GHashTable * properties, GError * err app->validated = TRUE; + app->id = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ID)); + app->category = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_CATEGORY)); + ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(app->appstore); + app_lru_file_touch(priv->lrufile, app->id, app->category); + app->icon = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_ICON_NAME)); app->menu = g_value_dup_string(g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_MENU)); if (g_hash_table_lookup(properties, NOTIFICATION_ITEM_PROP_AICON_NAME) != NULL) { @@ -275,6 +284,12 @@ application_free (Application * app) g_object_unref(app->prop_proxy); } + if (app->id != NULL) { + g_free(app->id); + } + if (app->category != NULL) { + g_free(app->category); + } if (app->dbus_name != NULL) { g_free(app->dbus_name); } -- cgit v1.2.3 From a634890d9684f87b796670c89383066bb674863d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 19 Jan 2010 20:57:26 -0600 Subject: Switching to inserting in the application array using a sort function. Looking that up in the LRU file DB. --- src/application-service-appstore.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 7d925d2..4cb2ab6 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -350,6 +350,18 @@ can_add_application (GList *applications, Application *app) return TRUE; } +/* This function takes two Application structure + pointers and uses the lrufile to compare them. */ +static gint +app_sort_func (gconstpointer a, gconstpointer b, gpointer userdata) +{ + Application * appa = (Application *)a; + Application * appb = (Application *)b; + AppLruFile * lrufile = (AppLruFile *)userdata; + + return app_lru_file_sort(lrufile, appa->id, appb->id); +} + /* Change the status of the application. If we're going passive it removes it from the panel. If we're coming online, then it add it to the panel. Otherwise it changes the icon. */ @@ -384,16 +396,12 @@ apply_status (Application * app, ApplicationStatus status) if (app->status == APP_STATUS_PASSIVE) { if (can_add_application (priv->applications, app)) { /* Put on panel */ - priv->applications = g_list_prepend (priv->applications, app); - - /* TODO: We need to have the position determined better. This - would involve looking at the name and category and sorting - it with the other entries. */ + priv->applications = g_list_insert_sorted_with_data (priv->applications, app, app_sort_func, priv->lrufile); g_signal_emit(G_OBJECT(app->appstore), signals[APPLICATION_ADDED], 0, newicon, - 0, /* Position */ + g_list_index(priv->applications, app), /* Position */ app->dbus_name, app->menu, app->icon_path, -- cgit v1.2.3 From c663b234f90d1b6b5c5eea53d309d5295342b1e0 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 11:14:21 -0600 Subject: Allocating memory and objects in the lur world --- src/application-service-lru-file.c | 69 +++++++++++++++++++++++++++++++++++++- 1 file changed, 68 insertions(+), 1 deletion(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index 47cfab9..a041453 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -6,7 +6,18 @@ typedef struct _AppLruFilePrivate AppLruFilePrivate; struct _AppLruFilePrivate { - gint temp; + GHashTable * apps; + gboolean dirty; + guint timer; + gchar * filename; +}; + +typedef struct _AppData AppData; +struct _AppData { + gchar * id; + gchar * category; + GTimeVal last_touched; + GTimeVal first_touched; }; #define APP_LRU_FILE_GET_PRIVATE(o) \ @@ -16,9 +27,12 @@ static void app_lru_file_class_init (AppLruFileClass *klass); static void app_lru_file_init (AppLruFile *self); static void app_lru_file_dispose (GObject *object); static void app_lru_file_finalize (GObject *object); +static void app_data_free (gpointer data); +static gboolean load_from_file (gpointer data); G_DEFINE_TYPE (AppLruFile, app_lru_file, G_TYPE_OBJECT); +/* Set up the class variable stuff */ static void app_lru_file_class_init (AppLruFileClass *klass) { @@ -32,29 +46,82 @@ app_lru_file_class_init (AppLruFileClass *klass) return; } +/* Set all the data of the per-instance variables */ static void app_lru_file_init (AppLruFile *self) { + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(self); + + /* Default values */ + priv->apps = NULL; + priv->dirty = FALSE; + priv->timer = 0; + priv->filename = NULL; + + /* Now let's build some stuff */ + priv->apps = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, app_data_free); + priv->filename = g_build_filename(g_get_user_config_dir(), "indicators", "application", "lru-file.json", NULL); + + /* No reason to delay other stuff for this, we'll + merge any values that get touched. */ + g_idle_add(load_from_file, self); return; } +/* Get rid of objects and other big things */ static void app_lru_file_dispose (GObject *object) { + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(object); + + if (priv->timer != 0) { + g_source_remove(priv->timer); + priv->timer = 0; + } + + if (priv->apps != NULL) { + /* Cleans up the keys and entries itself */ + g_hash_table_destroy(priv->apps); + priv->apps = NULL; + } G_OBJECT_CLASS (app_lru_file_parent_class)->dispose (object); return; } +/* Deallocate memory */ static void app_lru_file_finalize (GObject *object) { + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(object); + + if (priv->filename != NULL) { + g_free(priv->filename); + priv->filename = NULL; + } G_OBJECT_CLASS (app_lru_file_parent_class)->finalize (object); return; } +/* Takes an AppData structure and free's the + memory from it. */ +static void +app_data_free (gpointer data) +{ + + return; +} + +/* Loads all of the data out of a json file */ +static gboolean +load_from_file (gpointer data) +{ + + return FALSE; +} + /* API */ /* Simple helper to create a new object */ -- cgit v1.2.3 From 064fd75a5fe489e03bba5b99ed170401d2fa1def Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 11:45:13 -0600 Subject: Fleshing out touching. --- src/application-service-lru-file.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index a041453..45fe9db 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -14,7 +14,6 @@ struct _AppLruFilePrivate { typedef struct _AppData AppData; struct _AppData { - gchar * id; gchar * category; GTimeVal last_touched; GTimeVal first_touched; @@ -110,6 +109,13 @@ app_lru_file_finalize (GObject *object) static void app_data_free (gpointer data) { + AppData * appdata = (AppData *)data; + + if (appdata->category != NULL) { + g_free(appdata->category); + } + + g_free(appdata); return; } @@ -142,6 +148,26 @@ app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * catego g_return_if_fail(id != NULL && id[0] != '\0'); g_return_if_fail(category != NULL && category[0] != '\0'); + AppData * appdata = NULL; + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); + gpointer data = g_hash_table_lookup(priv->apps, id); + + if (data == NULL) { + /* Oh, we don't have one, let's build it and put it + into the hash table ourselves */ + appdata = g_new0(AppData, 1); + + appdata->category = g_strdup(category); + g_get_current_time(&(appdata->first_touched)); + /* NOTE: last touched set below */ + + g_hash_table_insert(priv->apps, g_strdup(id), appdata); + } else { + /* Boring, we've got this one already */ + appdata = (AppData *)data; + } + + g_get_current_time(&(appdata->last_touched)); return; } -- cgit v1.2.3 From 77f24c0cb4e46ea88a4594bd63875691c25234e4 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 11:59:33 -0600 Subject: Making a sort function that looks at two Apps and determines their ordering. --- src/application-service-lru-file.c | 46 +++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index 45fe9db..fd0b7ed 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -167,7 +167,9 @@ app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * catego appdata = (AppData *)data; } + /* Touch it and mark the DB as dirty */ g_get_current_time(&(appdata->last_touched)); + /* TODO: Make dirty */ return; } @@ -177,6 +179,48 @@ app_lru_file_sort (AppLruFile * lrufile, const gchar * id_a, const gchar * id_b) { g_return_val_if_fail(IS_APP_LRU_FILE(lrufile), -1); + /* Let's first look to see if the IDs are the same, this + really shouldn't happen, but it'll be confusing if we + don't get it out of the way to start. */ + if (g_strcmp0(id_a, id_b) == 0) { + return 0; + } + + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); + + /* Now make sure we have app data for both of these. If + not we'll assume that the one without is newer? */ + gpointer data_a = g_hash_table_lookup(priv->apps, id_a); + if (data_a == NULL) { + return -1; + } + + gpointer data_b = g_hash_table_lookup(priv->apps, id_b); + if (data_b == NULL) { + return 1; + } + + /* Ugly casting */ + AppData * appdata_a = (AppData *)data_a; + AppData * appdata_b = (AppData *)data_b; + + /* Look at categories, we'll put the categories in alpha + order if they're not the same. */ + gint catcompare = g_strcmp0(appdata_a->category, appdata_b->category); + if (catcompare != 0) { + return catcompare; + } + + /* Now we're looking at the first time that these two were + seen in this account. Only using seconds. I mean, seriously. */ + if (appdata_a->first_touched.tv_sec < appdata_b->first_touched.tv_sec) { + return -1; + } + if (appdata_b->first_touched.tv_sec < appdata_a->first_touched.tv_sec) { + return 1; + } - return 0; + /* Eh, this seems roughly impossible. But if we have to choose, + I like A better. */ + return 1; } -- cgit v1.2.3 From de476ff16608cc71b09c8ed6591c728b486f4b94 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 13:36:38 -0600 Subject: Fleshing out the cleaning and dirtying functions. Now we should write out a file. --- src/application-service-lru-file.c | 130 ++++++++++++++++++++++++++++++++++++- 1 file changed, 129 insertions(+), 1 deletion(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index fd0b7ed..c7911bc 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -2,6 +2,8 @@ #include "config.h" #endif +#include +#include #include "application-service-lru-file.h" typedef struct _AppLruFilePrivate AppLruFilePrivate; @@ -28,6 +30,9 @@ static void app_lru_file_dispose (GObject *object); static void app_lru_file_finalize (GObject *object); static void app_data_free (gpointer data); static gboolean load_from_file (gpointer data); +static void clean_off_hash_cb (gpointer key, gpointer value, gpointer data); +static void clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data); +static void clean_off_write_end_cb (GObject * obj, GAsyncResult * res, gpointer data); G_DEFINE_TYPE (AppLruFile, app_lru_file, G_TYPE_OBJECT); @@ -128,6 +133,129 @@ load_from_file (gpointer data) return FALSE; } +/* Write out our cache to a file so that we can unmark the dirty + bit and be happy. */ +static gboolean +clean_off (gpointer data) +{ + AppLruFile * lrufile = (AppLruFile *)data; + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); + priv->timer = 0; + + GError * error = NULL; + GFile * file = g_file_new_for_path(priv->filename); + GFileOutputStream * ostream = g_file_replace(file, + NULL, /* etag */ + TRUE, /* backup */ + G_FILE_CREATE_NONE, /* flags */ + NULL, /* cancelable */ + &error); + if (error != NULL) { + g_warning("Unable to open a file to store LRU file: %s", error->message); + return FALSE; + } + + /* This is how the file will start and end. */ + gchar * start = g_strdup("{\n \"version\": 1"); + gchar * end = g_strdup("\n}\n"); + + /* Put the front on. */ + g_output_stream_write_async(G_OUTPUT_STREAM(ostream), + start, + strlen(start), + G_PRIORITY_LOW, + NULL, + clean_off_write_cb, + start); + + /* Put the middle in. */ + g_hash_table_foreach (priv->apps, clean_off_hash_cb, ostream); + + + /* And then tack on the end. */ + g_output_stream_write_async(G_OUTPUT_STREAM(ostream), + end, + strlen(end), + G_PRIORITY_LOW, + NULL, + clean_off_write_end_cb, + end); + + return FALSE; /* drop the timer */ +} + +/* Looks at every value in the applications hash table and + turns it into a string for writing out. */ +static void +clean_off_hash_cb (gpointer key, gpointer value, gpointer data) +{ + /* Mega-cast */ + gchar * id = (gchar *)key; + AppData * appdata = (AppData *)value; + GOutputStream * ostream = (GOutputStream *)ostream; + + gchar * firsttime = g_time_val_to_iso8601(&appdata->first_touched); + gchar * lasttime = g_time_val_to_iso8601(&appdata->last_touched); + + gchar * output = g_strdup_printf(",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\"}", id, firsttime, lasttime); + + g_free(lasttime); + g_free(firsttime); + + g_output_stream_write_async(ostream, + output, + strlen(output), + G_PRIORITY_LOW, + NULL, + clean_off_write_cb, + output); + + return; +} + +/* After the data has been written to the file we make + sure to free the string we created */ +static void +clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data) +{ + g_free(data); + return; +} + +/* Very much like clean_off_write_cb except that it is the + last actor on this Output Stream so it closes it. */ +static void +clean_off_write_end_cb (GObject * obj, GAsyncResult * res, gpointer data) +{ + clean_off_write_cb(obj, res, data); + + GError * error = NULL; + g_output_stream_close(G_OUTPUT_STREAM(obj), NULL, &error); + + if (error != NULL) { + g_warning("Unable to close LRU File: %s", error->message); + g_error_free(error); + } + + return; +} + +/* Sets the dirty bit if not already set and makes sure that + we have a timer to fix that at some point. */ +static void +get_dirty (AppLruFile * lrufile) +{ + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); + + priv->dirty = TRUE; + + if (priv->timer == 0) { + priv->timer = g_timeout_add_seconds(60, clean_off, lrufile); + } + + return; +} + /* API */ /* Simple helper to create a new object */ @@ -169,7 +297,7 @@ app_lru_file_touch (AppLruFile * lrufile, const gchar * id, const gchar * catego /* Touch it and mark the DB as dirty */ g_get_current_time(&(appdata->last_touched)); - /* TODO: Make dirty */ + get_dirty(lrufile); return; } -- cgit v1.2.3 From 39c33f772eb63624b4479a5d8a21eb58d37baf8e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 14:28:09 -0600 Subject: Build the directory and some debugging info --- src/application-service-lru-file.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index c7911bc..cb69a6e 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -143,6 +143,16 @@ clean_off (gpointer data) priv->timer = 0; GError * error = NULL; + + /* Check to see if our directory exists. Build it if not. */ + gchar * dirname = g_build_filename(g_get_user_config_dir(), "indicators", "application", NULL); + if (!g_file_test(dirname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { + GFile * dirfile = g_file_new_for_path(dirname); + g_file_make_directory_with_parents(dirfile, NULL, NULL); + g_object_unref(dirfile); + } + g_free(dirname); + GFile * file = g_file_new_for_path(priv->filename); GFileOutputStream * ostream = g_file_replace(file, NULL, /* etag */ @@ -163,10 +173,11 @@ clean_off (gpointer data) g_output_stream_write_async(G_OUTPUT_STREAM(ostream), start, strlen(start), - G_PRIORITY_LOW, + G_PRIORITY_DEFAULT_IDLE, NULL, clean_off_write_cb, start); + g_debug("Start Write : %s", start); /* Put the middle in. */ g_hash_table_foreach (priv->apps, clean_off_hash_cb, ostream); @@ -176,10 +187,11 @@ clean_off (gpointer data) g_output_stream_write_async(G_OUTPUT_STREAM(ostream), end, strlen(end), - G_PRIORITY_LOW, + G_PRIORITY_DEFAULT_IDLE, NULL, clean_off_write_end_cb, end); + g_debug("Start Write : %s", end); return FALSE; /* drop the timer */ } @@ -192,7 +204,7 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) /* Mega-cast */ gchar * id = (gchar *)key; AppData * appdata = (AppData *)value; - GOutputStream * ostream = (GOutputStream *)ostream; + GOutputStream * ostream = (GOutputStream *)data; gchar * firsttime = g_time_val_to_iso8601(&appdata->first_touched); gchar * lasttime = g_time_val_to_iso8601(&appdata->last_touched); @@ -205,10 +217,11 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) g_output_stream_write_async(ostream, output, strlen(output), - G_PRIORITY_LOW, + G_PRIORITY_DEFAULT_IDLE, NULL, clean_off_write_cb, output); + g_debug("Start Write : %s", output); return; } @@ -218,6 +231,7 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) static void clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data) { + g_debug("Complete Write: %s", (gchar *)data); g_free(data); return; } -- cgit v1.2.3 From 72432728b161a54dfd711242e17cd2e55a011c2c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 14:40:14 -0600 Subject: Switch to building a string and writing it out instead of async writes as the order doesn't seem to be predictable. --- src/application-service-lru-file.c | 53 ++++++++------------------------------ 1 file changed, 11 insertions(+), 42 deletions(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index cb69a6e..95ffb3c 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -31,7 +31,6 @@ static void app_lru_file_finalize (GObject *object); static void app_data_free (gpointer data); static gboolean load_from_file (gpointer data); static void clean_off_hash_cb (gpointer key, gpointer value, gpointer data); -static void clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data); static void clean_off_write_end_cb (GObject * obj, GAsyncResult * res, gpointer data); G_DEFINE_TYPE (AppLruFile, app_lru_file, G_TYPE_OBJECT); @@ -165,33 +164,22 @@ clean_off (gpointer data) return FALSE; } - /* This is how the file will start and end. */ - gchar * start = g_strdup("{\n \"version\": 1"); - gchar * end = g_strdup("\n}\n"); - - /* Put the front on. */ - g_output_stream_write_async(G_OUTPUT_STREAM(ostream), - start, - strlen(start), - G_PRIORITY_DEFAULT_IDLE, - NULL, - clean_off_write_cb, - start); - g_debug("Start Write : %s", start); + /* This is how the file will start */ + GString * filestring = g_string_new("{\n \"version\": 1"); /* Put the middle in. */ - g_hash_table_foreach (priv->apps, clean_off_hash_cb, ostream); - + g_hash_table_foreach (priv->apps, clean_off_hash_cb, filestring); /* And then tack on the end. */ + g_string_append(filestring, "\n}\n"); + gchar * filedata = g_string_free(filestring, FALSE); g_output_stream_write_async(G_OUTPUT_STREAM(ostream), - end, - strlen(end), + filedata, + strlen(filedata), G_PRIORITY_DEFAULT_IDLE, NULL, clean_off_write_end_cb, - end); - g_debug("Start Write : %s", end); + filedata); return FALSE; /* drop the timer */ } @@ -204,35 +192,16 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) /* Mega-cast */ gchar * id = (gchar *)key; AppData * appdata = (AppData *)value; - GOutputStream * ostream = (GOutputStream *)data; + GString * string = (GString *)data; gchar * firsttime = g_time_val_to_iso8601(&appdata->first_touched); gchar * lasttime = g_time_val_to_iso8601(&appdata->last_touched); - gchar * output = g_strdup_printf(",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\"}", id, firsttime, lasttime); + g_string_append_printf(string, ",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\"}", id, firsttime, lasttime); g_free(lasttime); g_free(firsttime); - g_output_stream_write_async(ostream, - output, - strlen(output), - G_PRIORITY_DEFAULT_IDLE, - NULL, - clean_off_write_cb, - output); - g_debug("Start Write : %s", output); - - return; -} - -/* After the data has been written to the file we make - sure to free the string we created */ -static void -clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data) -{ - g_debug("Complete Write: %s", (gchar *)data); - g_free(data); return; } @@ -241,7 +210,7 @@ clean_off_write_cb (GObject * obj, GAsyncResult * res, gpointer data) static void clean_off_write_end_cb (GObject * obj, GAsyncResult * res, gpointer data) { - clean_off_write_cb(obj, res, data); + g_free(data); GError * error = NULL; g_output_stream_close(G_OUTPUT_STREAM(obj), NULL, &error); -- cgit v1.2.3 From 0ba7549d984e0e6ef5d2600075609916ac6a2734 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 14:47:49 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 250d7f8..078de6e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.9-0ubuntu1~ppa2) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa2) karmic; urgency=low * Upstream update * Support getting the app list from a running service. - -- Ted Gould Wed, 20 Jan 2010 14:44:45 -0600 + -- Ted Gould Wed, 20 Jan 2010 14:47:47 -0600 indicator-application (0.0.9-0ubuntu1~ppa1) karmic; urgency=low -- cgit v1.2.3 From 2062afe66d50fc10ff839ab7a0d127f5eaaa9197 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 14:59:53 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa3 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 0a5b26f..18df537 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.9-0ubuntu1~ppa3) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa3) karmic; urgency=low * Upstream update * Ref counting theme directories as they get added and removed * Use the right callback function for fallback (LP: #507975) - -- Ted Gould Wed, 20 Jan 2010 14:54:22 -0600 + -- Ted Gould Wed, 20 Jan 2010 14:59:48 -0600 indicator-application (0.0.9-0ubuntu1~ppa2) karmic; urgency=low -- cgit v1.2.3 From 5317706e5e2c21962a872f0bbe2cbd948d520e95 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 15:53:17 -0600 Subject: Fleshing out loading of the LRU file and realizing we need a json-glib dep and the 'category' field in the output. --- configure.ac | 3 ++ src/application-service-lru-file.c | 80 +++++++++++++++++++++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index ebd6b20..5855168 100644 --- a/configure.ac +++ b/configure.ac @@ -40,9 +40,11 @@ AC_CONFIG_MACRO_DIR(m4) GTK_REQUIRED_VERSION=2.12 INDICATOR_REQUIRED_VERSION=0.3.0 DBUSMENUGTK_REQUIRED_VERSION=0.1.1 +JSON_GLIB_REQUIRED_VERSION=0.7.6 PKG_CHECK_MODULES(INDICATOR, gtk+-2.0 >= $GTK_REQUIRED_VERSION indicator >= $INDICATOR_REQUIRED_VERSION + json-glib-1.0 >= $JSON_GLIB_REQUIRED_VERSION dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION) AC_SUBST(INDICATOR_CFLAGS) @@ -51,6 +53,7 @@ AC_SUBST(INDICATOR_LIBS) ########################### # Check for Mono support ########################### + MONO_REQUIRED_VERSION=1.0 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, has_mono=true, has_mono=false) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index 95ffb3c..de28b81 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -4,6 +4,7 @@ #include #include +#include #include "application-service-lru-file.h" typedef struct _AppLruFilePrivate AppLruFilePrivate; @@ -30,6 +31,7 @@ static void app_lru_file_dispose (GObject *object); static void app_lru_file_finalize (GObject *object); static void app_data_free (gpointer data); static gboolean load_from_file (gpointer data); +static void load_file_object_cb (JsonObject * obj, const gchar * key, JsonNode * value, gpointer data); static void clean_off_hash_cb (gpointer key, gpointer value, gpointer data); static void clean_off_write_end_cb (GObject * obj, GAsyncResult * res, gpointer data); @@ -128,10 +130,86 @@ app_data_free (gpointer data) static gboolean load_from_file (gpointer data) { + AppLruFile * lrufile = (AppLruFile *)data; + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); + + if (!g_file_test(priv->filename, G_FILE_TEST_EXISTS)) { + return FALSE; + } + + JsonParser * parser = json_parser_new(); + if (!json_parser_load_from_file(parser, priv->filename, NULL)) { + g_warning("Unable to parse JSON file '%s'", priv->filename); + g_object_unref(parser); + return FALSE; + } + + JsonNode * root = json_parser_get_root(parser); + JsonObject * rootobj = json_node_get_object(root); + if (rootobj == NULL) { + g_warning("Malformed LRU file. The root node is not an object."); + g_object_unref(parser); + return FALSE; + } + + json_object_foreach_member(rootobj, load_file_object_cb, priv); + + g_object_unref(parser); return FALSE; } +/* Looks at the various things that we need on a node, makes + sure that we have them, and then copies them into the + application hash table of love. */ +static void +load_file_object_cb (JsonObject * rootobj, const gchar * key, JsonNode * value, gpointer data) +{ + AppLruFilePrivate * priv = (AppLruFilePrivate *)data; + + /* We're not looking at this today. */ + if (!g_strcmp0(key, "version")) { + return; + } + + JsonObject * obj = json_node_get_object(value); + if (obj == NULL) { + g_warning("Data for node '%s' is not an object.", key); + return; + } + + const gchar * obj_category = json_object_get_string_member(obj, "category"); + const gchar * obj_first = json_object_get_string_member(obj, "first-time"); + const gchar * obj_last = json_object_get_string_member(obj, "last-time"); + + if (obj_category == NULL || obj_first == NULL || obj_last == NULL) { + g_warning("Node '%s' is missing data. Got: ('%s', '%s', '%s')", key, obj_category, obj_first, obj_last); + return; + } + + gpointer datapntr = g_hash_table_lookup(priv->apps, key); + if (datapntr == NULL) { + /* Build a new node */ + AppData * appdata = g_new0(AppData, 1); + appdata->category = g_strdup(obj_category); + g_time_val_from_iso8601(obj_first, &appdata->first_touched); + g_time_val_from_iso8601(obj_last, &appdata->last_touched); + + g_hash_table_insert(priv->apps, g_strdup(key), appdata); + } else { + /* Merge nodes */ + AppData * appdata = (AppData *)datapntr; + GTimeVal temptime; + g_time_val_from_iso8601(obj_first, &temptime); + + if (temptime.tv_sec < appdata->first_touched.tv_sec) { + g_time_val_from_iso8601(obj_first, &appdata->first_touched); + } + } + + return; +} + /* Write out our cache to a file so that we can unmark the dirty bit and be happy. */ static gboolean @@ -197,7 +275,7 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) gchar * firsttime = g_time_val_to_iso8601(&appdata->first_touched); gchar * lasttime = g_time_val_to_iso8601(&appdata->last_touched); - g_string_append_printf(string, ",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\"}", id, firsttime, lasttime); + g_string_append_printf(string, ",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\", \"category\": \"%s\"}", id, firsttime, lasttime, appdata->category); g_free(lasttime); g_free(firsttime); -- cgit v1.2.3 From 33644ed5b49b8af5a0d6b2f702c783319285db8d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:12:11 -0600 Subject: Moving the JSON file values into #defines --- src/application-service-lru-file.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index de28b81..26ff2e8 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -7,6 +7,11 @@ #include #include "application-service-lru-file.h" +#define ENTRY_CATEGORY "category" +#define ENTRY_FIRST_TIME "first-time" +#define ENTRY_LAST_TIME "last-time" +#define ENTRY_VERSION "version" + typedef struct _AppLruFilePrivate AppLruFilePrivate; struct _AppLruFilePrivate { GHashTable * apps; @@ -168,7 +173,7 @@ load_file_object_cb (JsonObject * rootobj, const gchar * key, JsonNode * value, AppLruFilePrivate * priv = (AppLruFilePrivate *)data; /* We're not looking at this today. */ - if (!g_strcmp0(key, "version")) { + if (!g_strcmp0(key, ENTRY_VERSION)) { return; } @@ -178,9 +183,9 @@ load_file_object_cb (JsonObject * rootobj, const gchar * key, JsonNode * value, return; } - const gchar * obj_category = json_object_get_string_member(obj, "category"); - const gchar * obj_first = json_object_get_string_member(obj, "first-time"); - const gchar * obj_last = json_object_get_string_member(obj, "last-time"); + const gchar * obj_category = json_object_get_string_member(obj, ENTRY_CATEGORY); + const gchar * obj_first = json_object_get_string_member(obj, ENTRY_FIRST_TIME); + const gchar * obj_last = json_object_get_string_member(obj, ENTRY_LAST_TIME); if (obj_category == NULL || obj_first == NULL || obj_last == NULL) { g_warning("Node '%s' is missing data. Got: ('%s', '%s', '%s')", key, obj_category, obj_first, obj_last); @@ -243,7 +248,7 @@ clean_off (gpointer data) } /* This is how the file will start */ - GString * filestring = g_string_new("{\n \"version\": 1"); + GString * filestring = g_string_new("{\n \"" ENTRY_VERSION "\": 1"); /* Put the middle in. */ g_hash_table_foreach (priv->apps, clean_off_hash_cb, filestring); @@ -275,7 +280,7 @@ clean_off_hash_cb (gpointer key, gpointer value, gpointer data) gchar * firsttime = g_time_val_to_iso8601(&appdata->first_touched); gchar * lasttime = g_time_val_to_iso8601(&appdata->last_touched); - g_string_append_printf(string, ",\n \"%s\": { \"first-time\": \"%s\", \"last-time\": \"%s\", \"category\": \"%s\"}", id, firsttime, lasttime, appdata->category); + g_string_append_printf(string, ",\n \"%s\": { \"" ENTRY_FIRST_TIME "\": \"%s\", \"" ENTRY_LAST_TIME "\": \"%s\", \"" ENTRY_CATEGORY "\": \"%s\"}", id, firsttime, lasttime, appdata->category); g_free(lasttime); g_free(firsttime); -- cgit v1.2.3 From 26a0d6f4bb11f7f31d1e8f0f6218cfca859f8a1f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:16:43 -0600 Subject: Moving directory and filename into defines --- src/application-service-lru-file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index 26ff2e8..a13227a 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -12,6 +12,9 @@ #define ENTRY_LAST_TIME "last-time" #define ENTRY_VERSION "version" +#define CONFIG_DIR ("indicators" G_DIR_SEPARATOR_S "application") +#define CONFIG_FILE "lru-file.json" + typedef struct _AppLruFilePrivate AppLruFilePrivate; struct _AppLruFilePrivate { GHashTable * apps; @@ -70,7 +73,7 @@ app_lru_file_init (AppLruFile *self) /* Now let's build some stuff */ priv->apps = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, app_data_free); - priv->filename = g_build_filename(g_get_user_config_dir(), "indicators", "application", "lru-file.json", NULL); + priv->filename = g_build_filename(g_get_user_config_dir(), CONFIG_DIR, CONFIG_FILE, NULL); /* No reason to delay other stuff for this, we'll merge any values that get touched. */ @@ -227,7 +230,7 @@ clean_off (gpointer data) GError * error = NULL; /* Check to see if our directory exists. Build it if not. */ - gchar * dirname = g_build_filename(g_get_user_config_dir(), "indicators", "application", NULL); + gchar * dirname = g_build_filename(g_get_user_config_dir(), CONFIG_DIR, NULL); if (!g_file_test(dirname, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) { GFile * dirfile = g_file_new_for_path(dirname); g_file_make_directory_with_parents(dirfile, NULL, NULL); -- cgit v1.2.3 From 0ccf950d37c2de390f79c10d9bebbd4ca6dfc894 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:28:13 -0600 Subject: License headers. --- src/application-service-lru-file.c | 22 ++++++++++++++++++++++ src/application-service-lru-file.h | 22 ++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index a13227a..fec9644 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -1,3 +1,25 @@ +/* +This object manages the database of when the entires were touched +and loved. And writes that out to disk occationally as well. + +Copyright 2010 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/src/application-service-lru-file.h b/src/application-service-lru-file.h index 45d3082..7c92c82 100644 --- a/src/application-service-lru-file.h +++ b/src/application-service-lru-file.h @@ -1,3 +1,25 @@ +/* +This object manages the database of when the entires were touched +and loved. And writes that out to disk occationally as well. + +Copyright 2010 Canonical Ltd. + +Authors: + Ted Gould + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see . +*/ + #ifndef __APP_LRU_FILE_H__ #define __APP_LRU_FILE_H__ -- cgit v1.2.3 From da6242ba497bf70eb2ee8c75e74ddf5ac7f699ca Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:41:38 -0600 Subject: Looking at the last touch date of entries as we're loading the file and removing ones that are very old. --- src/application-service-lru-file.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/application-service-lru-file.c b/src/application-service-lru-file.c index fec9644..c69a20f 100644 --- a/src/application-service-lru-file.c +++ b/src/application-service-lru-file.c @@ -60,6 +60,7 @@ static void app_lru_file_init (AppLruFile *self); static void app_lru_file_dispose (GObject *object); static void app_lru_file_finalize (GObject *object); static void app_data_free (gpointer data); +static void get_dirty (AppLruFile * lrufile); static gboolean load_from_file (gpointer data); static void load_file_object_cb (JsonObject * obj, const gchar * key, JsonNode * value, gpointer data); static void clean_off_hash_cb (gpointer key, gpointer value, gpointer data); @@ -183,7 +184,7 @@ load_from_file (gpointer data) return FALSE; } - json_object_foreach_member(rootobj, load_file_object_cb, priv); + json_object_foreach_member(rootobj, load_file_object_cb, lrufile); g_object_unref(parser); return FALSE; @@ -195,7 +196,8 @@ load_from_file (gpointer data) static void load_file_object_cb (JsonObject * rootobj, const gchar * key, JsonNode * value, gpointer data) { - AppLruFilePrivate * priv = (AppLruFilePrivate *)data; + AppLruFile * lrufile = (AppLruFile *)data; + AppLruFilePrivate * priv = APP_LRU_FILE_GET_PRIVATE(lrufile); /* We're not looking at this today. */ if (!g_strcmp0(key, ENTRY_VERSION)) { @@ -214,9 +216,35 @@ load_file_object_cb (JsonObject * rootobj, const gchar * key, JsonNode * value, if (obj_category == NULL || obj_first == NULL || obj_last == NULL) { g_warning("Node '%s' is missing data. Got: ('%s', '%s', '%s')", key, obj_category, obj_first, obj_last); + get_dirty(lrufile); + return; + } + + /* Check to see how old this entry is. If it hasn't been + used in the last year, we remove the cruft. */ + GTimeVal currenttime; + g_get_current_time(¤ttime); + GDate * currentdate = g_date_new(); + g_date_set_time_val(currentdate, ¤ttime); + + GTimeVal lasttouch; + g_time_val_from_iso8601(obj_last, &lasttouch); + GDate * lastdate = g_date_new(); + g_date_set_time_val(lastdate, &lasttouch); + + gint spread = g_date_days_between(lastdate, currentdate); + + g_date_free(currentdate); + g_date_free(lastdate); + + if (spread > 365) { + g_debug("Removing node '%s' as it's %d days old.", key, spread); + get_dirty(lrufile); return; } + /* See if we already have one of these. It's a little bit + unlikely, but since we're async, we need to check */ gpointer datapntr = g_hash_table_lookup(priv->apps, key); if (datapntr == NULL) { /* Build a new node */ -- cgit v1.2.3 From a9bf19636361c1d4a912db0a4d51d21d025b4640 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 20 Jan 2010 16:52:01 -0600 Subject: Implements the get_location function to place the entires. --- src/indicator-application.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/indicator-application.c b/src/indicator-application.c index 5ed7a9e..3ef5688 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -92,6 +92,7 @@ static void indicator_application_init (IndicatorApplication *self); static void indicator_application_dispose (GObject *object); static void indicator_application_finalize (GObject *object); static GList * get_entries (IndicatorObject * io); +static guint get_location (IndicatorObject * io, IndicatorObjectEntry * entry); 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, const gchar * icon_path, IndicatorApplication * application); static void application_removed (DBusGProxy * proxy, gint position , IndicatorApplication * application); @@ -116,6 +117,7 @@ indicator_application_class_init (IndicatorApplicationClass *klass) IndicatorObjectClass * io_class = INDICATOR_OBJECT_CLASS(klass); io_class->get_entries = get_entries; + io_class->get_location = get_location; dbus_g_object_register_marshaller(_application_service_marshal_VOID__STRING_INT_STRING_STRING_STRING, G_TYPE_NONE, @@ -298,6 +300,15 @@ get_entries (IndicatorObject * io) return retval; } +/* Finds the location of a specific entry */ +static guint +get_location (IndicatorObject * io, IndicatorObjectEntry * entry) +{ + g_return_val_if_fail(IS_INDICATOR_APPLICATION(io), 0); + IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(io); + return g_list_index(priv->applications, entry); +} + /* Here we respond to new applications by building up the ApplicationEntry and signaling the indicator host that we've got a new indicator. */ -- cgit v1.2.3 From d4f211aa742b9717bfdcd5faf9ef41d4eb750b75 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 08:53:36 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa4~order1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 98ebbc9..b65cb14 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,9 @@ -indicator-application (0.0.9-0ubuntu1~ppa4~order1) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa4~order1) karmic; urgency=low * Upstream merge * Adding in a file to position the indicators - -- Ted Gould Thu, 21 Jan 2010 08:50:57 -0600 + -- Ted Gould Thu, 21 Jan 2010 08:53:32 -0600 indicator-application (0.0.9-0ubuntu1~ppa3) karmic; urgency=low -- cgit v1.2.3 From 770afffd927421ced6e74d29a751dac394c2d5ec Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 08:55:32 -0600 Subject: debian/control: Adding dependency for json-glib to build. --- debian/changelog | 6 ++++++ debian/control | 1 + 2 files changed, 7 insertions(+) diff --git a/debian/changelog b/debian/changelog index b65cb14..9616370 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +indicator-application (0.0.9-0ubuntu1~ppa4~order2) UNRELEASED; urgency=low + + * debian/control: Adding dependency for json-glib to build. + + -- Ted Gould Thu, 21 Jan 2010 08:55:06 -0600 + indicator-application (0.0.9-0ubuntu1~ppa4~order1) karmic; urgency=low * Upstream merge diff --git a/debian/control b/debian/control index 253b911..49e67dd 100644 --- a/debian/control +++ b/debian/control @@ -8,6 +8,7 @@ Build-Depends: debhelper (>= 5.0), python-central (>= 0.6), libgtk2.0-dev (>= 2.12.0), libdbus-glib-1-dev, + libjson-glib-dev, gnome-doc-utils, gtk-doc-tools, intltool, -- cgit v1.2.3 From 678e0976a73cbe2ef0709ab939c76bf4bd24feff Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 08:57:59 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa4~order2 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index 9616370..bd050ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,8 @@ -indicator-application (0.0.9-0ubuntu1~ppa4~order2) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa4~order2) karmic; urgency=low * debian/control: Adding dependency for json-glib to build. - -- Ted Gould Thu, 21 Jan 2010 08:55:06 -0600 + -- Ted Gould Thu, 21 Jan 2010 08:57:56 -0600 indicator-application (0.0.9-0ubuntu1~ppa4~order1) karmic; urgency=low -- cgit v1.2.3 From 2377df37da27f6035282ed639b126ffd5dc8458a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 14:01:10 -0600 Subject: Require libindicator 0.3.1 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 5855168..b57f8c9 100644 --- a/configure.ac +++ b/configure.ac @@ -38,7 +38,7 @@ AC_CONFIG_MACRO_DIR(m4) ########################### GTK_REQUIRED_VERSION=2.12 -INDICATOR_REQUIRED_VERSION=0.3.0 +INDICATOR_REQUIRED_VERSION=0.3.1 DBUSMENUGTK_REQUIRED_VERSION=0.1.1 JSON_GLIB_REQUIRED_VERSION=0.7.6 -- cgit v1.2.3 From bb106d11cf9b49eae0f3c3a8ccf9d104e65fbd1b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 14:08:59 -0600 Subject: 0.0.10 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index b57f8c9..5549bd4 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(indicator-application, 0.0.9, ted@canonical.com) +AC_INIT(indicator-application, 0.0.10, ted@canonical.com) AC_COPYRIGHT([Copyright 2009, 2010 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-application, 0.0.9) +AM_INIT_AUTOMAKE(indicator-application, 0.0.10) AM_MAINTAINER_MODE -- cgit v1.2.3 From 8140c6f87cbd5d1615ab405b0d045c6566ced28b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 14:12:39 -0600 Subject: releasing version 0.0.9-0ubuntu1~ppa4 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index a44360b..6787b5d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,10 +1,10 @@ -indicator-application (0.0.9-0ubuntu1~ppa4) UNRELEASED; urgency=low +indicator-application (0.0.9-0ubuntu1~ppa4) karmic; urgency=low * Upstream merge * Adding in a file to position the indicators * debian/control: Adding dependency for json-glib to build. - -- Ted Gould Thu, 21 Jan 2010 14:10:09 -0600 + -- Ted Gould Thu, 21 Jan 2010 14:12:37 -0600 indicator-application (0.0.9-0ubuntu1~ppa3) karmic; urgency=low -- cgit v1.2.3 From f5582e9259c2cab7519c6bcfc900f7b06989b266 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 14:19:21 -0600 Subject: debian/control: Adjusted back changes in 0.0.9-0ubuntu3 as this branch is still on Karmic. Changes are in Lucid. --- debian/changelog | 2 ++ debian/control | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index eab47d7..cd77561 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,8 @@ indicator-application (0.0.10-0ubuntu1~ppa1) UNRELEASED; urgency=low * Use the right callback function for fallback (LP: #507975) * Support getting the app list from a running service. * debian/control: Adding dependency for json-glib to build. + * debian/control: Adjusted back changes in 0.0.9-0ubuntu3 as this + branch is still on Karmic. Changes are in Lucid. -- Ted Gould Thu, 21 Jan 2010 14:15:32 -0600 diff --git a/debian/control b/debian/control index 02eed84..49e67dd 100644 --- a/debian/control +++ b/debian/control @@ -24,7 +24,7 @@ Build-Depends: debhelper (>= 5.0), gtk-sharp2-gapi, libmono-dev, libnunit2.4-cil, - libgtk2.0-cil-dev + libgtk2.0-cil Standards-Version: 3.8.3 Homepage: https://launchpad.net/indicator-application Vcs-Bzr: http://bazaar.launchpad.net/~ubuntu-desktop/indicator-application/ubuntu -- cgit v1.2.3 From f25e2f07b3afbdfbe6088bb913cf091620a4ad16 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Thu, 21 Jan 2010 14:21:04 -0600 Subject: releasing version 0.0.10-0ubuntu1~ppa1 --- debian/changelog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index cd77561..c8c5512 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -indicator-application (0.0.10-0ubuntu1~ppa1) UNRELEASED; urgency=low +indicator-application (0.0.10-0ubuntu1~ppa1) karmic; urgency=low * Upstream release 0.0.10 * Adding in a file to position the indicators @@ -9,7 +9,7 @@ indicator-application (0.0.10-0ubuntu1~ppa1) UNRELEASED; urgency=low * debian/control: Adjusted back changes in 0.0.9-0ubuntu3 as this branch is still on Karmic. Changes are in Lucid. - -- Ted Gould Thu, 21 Jan 2010 14:15:32 -0600 + -- Ted Gould Thu, 21 Jan 2010 14:21:00 -0600 indicator-application (0.0.9-0ubuntu3) lucid; urgency=low -- cgit v1.2.3