[gnome-control-center] online-accounts: Complete account removal in cc_goa_panel_finalize()



commit d918b02c1f3637a0084b8dff7e73929254fc7906
Author: Andrea Azzarone <azzaronea gmail com>
Date:   Wed Mar 21 18:52:51 2018 +0100

    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

 panels/online-accounts/cc-online-accounts-panel.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
---
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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]