summaryrefslogtreecommitdiff
path: root/panels
diff options
context:
space:
mode:
authorAndrea Azzarone <azzaronea@gmail.com>2018-03-21 18:52:51 +0100
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>2018-03-27 21:09:46 +0000
commitd918b02c1f3637a0084b8dff7e73929254fc7906 (patch)
tree34b9a9cc8f7fea1141585bb27713c60509e4f57c /panels
parente7ef0e75ea9d20690340acc837b75afd3cc7b572 (diff)
downloadgnome-control-center-d918b02c1f3637a0084b8dff7e73929254fc7906.tar.gz
online-accounts: Complete account removal in cc_goa_panel_finalize()
When removing an online account, gnome-control-center gives the user the possibility to undo the action showing an "undo notification". Right now if you close the gnome-control-center window, without dismissing the notification, the online account will not be properly removed. https://gitlab.gnome.org/GNOME/gnome-control-center/issues/25
Diffstat (limited to 'panels')
-rw-r--r--panels/online-accounts/cc-online-accounts-panel.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/panels/online-accounts/cc-online-accounts-panel.c b/panels/online-accounts/cc-online-accounts-panel.c
index 835810003..3177a4d27 100644
--- a/panels/online-accounts/cc-online-accounts-panel.c
+++ b/panels/online-accounts/cc-online-accounts-panel.c
@@ -402,6 +402,22 @@ cc_goa_panel_finalize (GObject *object)
{
CcGoaPanel *panel = CC_GOA_PANEL (object);
+ if (panel->removed_object != NULL)
+ {
+ g_autoptr(GError) error = NULL;
+ goa_account_call_remove_sync (goa_object_peek_account (panel->removed_object),
+ NULL, /* GCancellable */
+ &error);
+
+ if (error != NULL)
+ {
+ g_warning ("Error removing account: %s (%s, %d)",
+ error->message,
+ g_quark_to_string (error->domain),
+ error->code);
+ }
+ }
+
g_clear_object (&panel->client);
G_OBJECT_CLASS (cc_goa_panel_parent_class)->finalize (object);