diff options
author | Ted Gould <ted@gould.cx> | 2010-08-18 14:26:38 -0500 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-08-18 14:26:38 -0500 |
commit | 9fc60ae8675fe81a3c051e5f4de0378ecfd75069 (patch) | |
tree | 98d2ef7dc65cd80b507fdc619884f52bba7e5f4b | |
parent | 1865cf3b4e415dcb8b9cf85208ab88596d00b043 (diff) | |
download | ayatana-indicator-application-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.tar.gz ayatana-indicator-application-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.tar.bz2 ayatana-indicator-application-9fc60ae8675fe81a3c051e5f4de0378ecfd75069.zip |
Flesh out the revise judgement handler to update the list of approvers.
-rw-r--r-- | src/application-service-appstore.c | 21 |
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; } |