From 93f92e8e6a6bda708d227f3ebe9c8dae15694b9e Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Aug 2010 12:41:02 -0500 Subject: Making the list so that if there are errors we handle them well. --- src/application-service-appstore.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 73fc5d1..85d72f7 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -578,10 +578,12 @@ apply_status (Application * app) ApplicationServiceAppstore * appstore = app->appstore; ApplicationServiceAppstorePrivate * priv = appstore->priv; + g_debug("Applying status. Status: %d Approved by: %d Approvers: %d Visible: %d", app->status, g_list_length(app->approved_by), g_list_length(priv->approvers), app->visible_state); + visible_state_t goal_state = VISIBLE_STATE_HIDDEN; if (app->status != APP_INDICATOR_STATUS_PASSIVE && - g_list_length(app->approved_by) == g_list_length(priv->approvers)) { + g_list_length(app->approved_by) >= g_list_length(priv->approvers)) { goal_state = VISIBLE_STATE_SHOWN; } -- cgit v1.2.3 From fb1811ef2421e512b49bc5bb5c2796ba669ca29f Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Aug 2010 12:42:41 -0500 Subject: Making it so that we don't set the proxy to null right away. --- src/application-service-appstore.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 85d72f7..9f1920d 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -75,6 +75,7 @@ typedef enum { typedef struct _Approver Approver; struct _Approver { DBusGProxy * proxy; + gboolean destroy_by_proxy; }; typedef struct _Application Application; @@ -1076,7 +1077,9 @@ approver_free (gpointer papprover, gpointer user_data) g_list_foreach(appstore->priv->applications, remove_approver, approver->proxy); if (approver->proxy != NULL) { - g_object_unref(approver->proxy); + if (!approver->destroy_by_proxy) { + g_object_unref(approver->proxy); + } approver->proxy = NULL; } @@ -1153,7 +1156,7 @@ approver_destroyed (gpointer pproxy, gpointer pappstore) } Approver * approver = (Approver *)lapprover->data; - approver->proxy = NULL; + approver->destroy_by_proxy = TRUE; appstore->priv->approvers = g_list_remove(appstore->priv->approvers, approver); approver_free(approver, appstore); @@ -1171,6 +1174,7 @@ application_service_appstore_approver_add (ApplicationServiceAppstore * appstore ApplicationServiceAppstorePrivate * priv = APPLICATION_SERVICE_APPSTORE_GET_PRIVATE (appstore); Approver * approver = g_new0(Approver, 1); + approver->destroy_by_proxy = FALSE; GError * error = NULL; approver->proxy = dbus_g_proxy_new_for_name_owner(priv->bus, -- cgit v1.2.3 From 72c93f2c3aea90bc18a694a723915f33701a021b Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Mon, 16 Aug 2010 12:43:38 -0500 Subject: Commenting out debug message --- src/application-service-appstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/application-service-appstore.c b/src/application-service-appstore.c index 9f1920d..30af2ea 100644 --- a/src/application-service-appstore.c +++ b/src/application-service-appstore.c @@ -579,7 +579,7 @@ apply_status (Application * app) ApplicationServiceAppstore * appstore = app->appstore; ApplicationServiceAppstorePrivate * priv = appstore->priv; - g_debug("Applying status. Status: %d Approved by: %d Approvers: %d Visible: %d", app->status, g_list_length(app->approved_by), g_list_length(priv->approvers), app->visible_state); + /* g_debug("Applying status. Status: %d Approved by: %d Approvers: %d Visible: %d", app->status, g_list_length(app->approved_by), g_list_length(priv->approvers), app->visible_state); */ visible_state_t goal_state = VISIBLE_STATE_HIDDEN; -- cgit v1.2.3