aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-08-18 14:26:38 -0500
committerTed Gould <ted@gould.cx>2010-08-18 14:26:38 -0500
commit9fc60ae8675fe81a3c051e5f4de0378ecfd75069 (patch)
tree98d2ef7dc65cd80b507fdc619884f52bba7e5f4b
parent1865cf3b4e415dcb8b9cf85208ab88596d00b043 (diff)
downloadlibayatana-appindicator-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.tar.gz
libayatana-appindicator-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.tar.bz2
libayatana-appindicator-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.zip
Flesh out the revise judgement handler to update the list of approvers.
-rw-r--r--src/application-service-appstore.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c
index 7040b2a..2d77d28 100644
--- a/src/application-service-appstore.c
+++ b/src/application-service-appstore.c
@@ -1188,8 +1188,27 @@ approver_destroyed (gpointer pproxy, gpointer pappstore)
void
approver_revise_judgement (DBusGProxy * proxy, gboolean new_status, gchar * address, DBusGProxy * get_path, gpointer user_data)
{
+ g_return_if_fail(IS_APPLICATION_SERVICE_APPSTORE(user_data));
+ g_return_if_fail(address != NULL && address[0] != '\0');
+ g_return_if_fail(get_path != NULL);
+ const gchar * path = dbus_g_proxy_get_path(get_path);
+ g_return_if_fail(path != NULL && path[0] != '\0');
+
ApplicationServiceAppstore * appstore = APPLICATION_SERVICE_APPSTORE(user_data);
- appstore = NULL;
+
+ Application * app = find_application(appstore, address, path);
+
+ if (app == NULL) {
+ g_warning("Unable to update approver status of application (%s:%s) as it was not found", address, path);
+ return;
+ }
+
+ if (new_status) {
+ app->approved_by = g_list_prepend(app->approved_by, proxy);
+ } else {
+ app->approved_by = g_list_remove(app->approved_by, proxy);
+ }
+ apply_status(app);
return;
}