From 06e5e1461bdfb94064c512078728512402d3ee0b Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Thu, 13 Jan 2011 11:03:04 -0600 Subject: don't second guess service's new application, which caused our positions to get out of sync with the service if it was a bit confused --- src/indicator-application.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/indicator-application.c b/src/indicator-application.c index 1de8785..5754ac4 100644 --- a/src/indicator-application.c +++ b/src/indicator-application.c @@ -381,22 +381,6 @@ get_location (IndicatorObject * io, IndicatorObjectEntry * entry) return g_list_index(priv->applications, entry); } -/* Searching for ApplicationEntries where the dbusobject and - address are the same. */ -static gint -application_added_search (gconstpointer a, gconstpointer b) -{ - ApplicationEntry * appa = (ApplicationEntry *)a; - ApplicationEntry * appb = (ApplicationEntry *)b; - - if (g_strcmp0(appa->dbusaddress, appb->dbusaddress) == 0 && - g_strcmp0(appa->dbusobject, appb->dbusobject) == 0) { - return 0; - } - - return -1; -} - /* Does a quick meausre of how big the string is in pixels with a Pango layout */ static gint @@ -444,22 +428,9 @@ static void application_added (IndicatorApplication * application, const gchar * iconname, gint position, const gchar * dbusaddress, const gchar * dbusobject, const gchar * icon_theme_path, const gchar * label, const gchar * guide) { g_return_if_fail(IS_INDICATOR_APPLICATION(application)); - g_debug("Building new application entry: %s with icon: %s", dbusaddress, iconname); + g_debug("Building new application entry: %s with icon: %s at position %i", dbusaddress, iconname, position); IndicatorApplicationPrivate * priv = INDICATOR_APPLICATION_GET_PRIVATE(application); - /* First search to see if we already have this entry */ - ApplicationEntry searchapp; - searchapp.dbusaddress = (gchar *)dbusaddress; /* Casting off const, but it's okay, we're not changing it */ - searchapp.dbusobject = (gchar *)dbusobject; /* Casting off const, but it's okay, we're not changing it */ - - GList * searchpointer = g_list_find_custom(priv->applications, &searchapp, application_added_search); - if (searchpointer != NULL) { - g_debug("\t...Already have that one."); - ApplicationEntry * app = (ApplicationEntry *)searchpointer->data; - app->old_service = FALSE; - return; - } - ApplicationEntry * app = g_new(ApplicationEntry, 1); app->old_service = FALSE; -- cgit v1.2.3