diff options
author | Andrea Azzarone <azzaronea@gmail.com> | 2018-03-21 18:52:51 +0100 |
---|---|---|
committer | Georges Basile Stavracas Neto <georges.stavracas@gmail.com> | 2018-03-28 01:04:00 +0000 |
commit | 745a98c9600702082456ce40f3fb96dbd7e65999 (patch) | |
tree | b62d9342f684860762dfff5708b9bed6866171e3 | |
parent | a8fa09bda4e26f9dcf7df7c96e02218a934e8f1f (diff) | |
download | gnome-control-center-745a98c9600702082456ce40f3fb96dbd7e65999.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
(cherry picked from commit d918b02c1f3637a0084b8dff7e73929254fc7906)
-rw-r--r-- | panels/online-accounts/cc-online-accounts-panel.c | 16 |
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); |