From ad42e1044d1bc653a3df8ce76e6e74d79ea890cc Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Fri, 8 Jan 2010 11:53:21 -0600 Subject: Fleshing out some of the remove function. For some reason the appstore is getting disposed, but that's the next thing to look at. --- src/application-service-appstore.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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; } -- cgit v1.2.3