aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-09-07 19:22:05 -0500
committerTed Gould <ted@gould.cx>2010-09-07 19:22:05 -0500
commitc5603404da69d9e7137b840ba47ca58b5b739c4f (patch)
tree43729d59b91762c85f0c7f149e7284cd5d5b3dbe
parent01ca0dc5240367fe714116a42917a9c349f98a83 (diff)
downloadayatana-indicator-application-c5603404da69d9e7137b840ba47ca58b5b739c4f.tar.gz
ayatana-indicator-application-c5603404da69d9e7137b840ba47ca58b5b739c4f.tar.bz2
ayatana-indicator-application-c5603404da69d9e7137b840ba47ca58b5b739c4f.zip
Check for duplicate additions of applications and just rerequest properties.
-rw-r--r--src/application-service-appstore.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index eaaec6b..7096382 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -131,6 +131,7 @@ static AppIndicatorCategory string_to_cat(const gchar * cat_string);
static void approver_free (gpointer papprover, gpointer user_data);
static void check_with_new_approver (gpointer papp, gpointer papprove);
static void check_with_old_approver (gpointer papprove, gpointer papp);
+static Application * find_application (ApplicationServiceAppstore * appstore, const gchar * address, const gchar * object);
G_DEFINE_TYPE (ApplicationServiceAppstore, application_service_appstore, G_TYPE_OBJECT);
@@ -855,10 +856,20 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0');
ApplicationServiceAppstorePrivate * priv = appstore->priv;
+ Application * app = find_application(appstore, dbus_name, dbus_object);
+
+ if (app != NULL) {
+ g_warning("Application already exists! Rerequesting properties.");
+ org_freedesktop_DBus_Properties_get_all_async(app->prop_proxy,
+ NOTIFICATION_ITEM_DBUS_IFACE,
+ get_all_properties_cb,
+ app);
+ return;
+ }
/* Build the application entry. This will be carried
along until we're sure we've got everything. */
- Application * app = g_new0(Application, 1);
+ app = g_new0(Application, 1);
app->validated = FALSE;
app->dbus_name = g_strdup(dbus_name);