- if (!server_account) {
- gchar *server_account_name, *default_account_name;
-
- /* If this was the default, then remove that setting: */
- default_account_name = modest_account_mgr_get_default_account (self);
- if (default_account_name && (strcmp (default_account_name, name) == 0)) {
- modest_account_mgr_unset_default_account (self);
- default_account_deleted = TRUE;
- }
- g_free (default_account_name);
-
- /* in case we're deleting an account, also delete the dependent store and transport account */
- server_account_name = modest_account_mgr_get_string (self, name, MODEST_ACCOUNT_STORE_ACCOUNT,
- FALSE);
- if (server_account_name) {
- if (!modest_account_mgr_remove_account (self, server_account_name, TRUE))
- g_printerr ("modest: failed to remove store account '%s' (%s)\n",
- server_account_name, name);
- g_free (server_account_name);
- } else
- g_printerr ("modest: could not find the store account for %s\n", name);
-
- server_account_name = modest_account_mgr_get_string (self, name, MODEST_ACCOUNT_TRANSPORT_ACCOUNT,
- FALSE);
- if (server_account_name) {
- if (!modest_account_mgr_remove_account (self, server_account_name, TRUE))
- g_printerr ("modest: failed to remove transport account '%s' (%s)\n",
- server_account_name, name);
- g_free (server_account_name);
- } else
- g_printerr ("modest: could not find the transport account for %s\n", name);
+ /* If this was the default, then remove that setting: */
+ default_account_name = modest_account_mgr_get_default_account (self);
+ if (default_account_name && (strcmp (default_account_name, name) == 0)) {
+ modest_account_mgr_unset_default_account (self);
+ default_account_deleted = TRUE;