aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-01-08 11:53:21 -0600
committerTed Gould <ted@gould.cx>2010-01-08 11:53:21 -0600
commitad42e1044d1bc653a3df8ce76e6e74d79ea890cc (patch)
tree898e1da60a28099ea021a43401bd658bf0c5c950
parent96e4332ec96cd0b649d829857efb4d4f0268bb76 (diff)
downloadlibayatana-appindicator-ad42e1044d1bc653a3df8ce76e6e74d79ea890cc.tar.gz
libayatana-appindicator-ad42e1044d1bc653a3df8ce76e6e74d79ea890cc.tar.bz2
libayatana-appindicator-ad42e1044d1bc653a3df8ce76e6e74d79ea890cc.zip
Fleshing out some of the remove function. For some reason the appstore is getting disposed, but that's the next thing to look at.
-rw-r--r--src/application-service-appstore.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index ae9876e..3215b49 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -585,6 +585,8 @@ application_service_appstore_application_add (ApplicationServiceAppstore * appst
return;
}
+/* Removes an application. Currently only works for the apps
+ that are shown. /TODO Need to fix that. */
void
application_service_appstore_application_remove (ApplicationServiceAppstore * appstore, const gchar * dbus_name, const gchar * dbus_object)
{
@@ -592,6 +594,17 @@ application_service_appstore_application_remove (ApplicationServiceAppstore * ap
g_return_if_fail(dbus_name != NULL && dbus_name[0] != '\0');
g_return_if_fail(dbus_object != NULL && dbus_object[0] != '\0');
+ ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE(appstore);
+ GList * listpntr;
+
+ for (listpntr = priv->applications; listpntr != NULL; listpntr = g_list_next(listpntr)) {
+ Application * app = (Application *)listpntr->data;
+
+ if (!g_strcmp0(app->dbus_name, dbus_name) && !g_strcmp0(app->dbus_object, dbus_object)) {
+ application_removed_cb(NULL, app);
+ break; /* NOTE: Must break as the list will become inconsistent */
+ }
+ }
return;
}