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:
parent
e7ef0e75ea
commit
d918b02c1f
1 changed files with 16 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue