From a11d8f16f4939353926b3cbf35217746fb488803 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 11 Mar 2011 16:19:02 -0600 Subject: Removing applications before adding new ones. --- src/indicator-application.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/indicator-application.c b/src/indicator-application.c index eabbf54..f59ffd7 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -833,12 +833,20 @@ get_applications (GObject * obj, GAsyncResult * res, gpointer user_data) } } + /* If we got an error, print it and exit out */ if (error != NULL) { g_warning("Unable to get application list: %s", error->message); g_error_free(error); return; } + /* Remove all applications that we previously had + as we're going to repopulate the list. */ + while (priv->applications != NULL) { + application_removed(self, 0); + } + + /* Get our new applications that we got in the request */ g_variant_get(result, "(a(sisossss))", &iter); while ((child = g_variant_iter_next_value (iter))) { get_applications_helper(self, child); -- cgit v1.2.3