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
This commit is contained in:
Andrea Azzarone 2018-03-21 18:52:51 +01:00 committed by Georges Basile Stavracas Neto
parent e7ef0e75ea
commit d918b02c1f

View file

@ -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);