+ /* Refilter the model */
+ gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (filter_model));
+
+ /* Select the first INBOX if the currently selected folder
+ belongs to the account that is being deleted */
+ if (priv->cur_folder_store) {
+ TnyAccount *folder_selected_account;
+
+ folder_selected_account = (TNY_IS_FOLDER (priv->cur_folder_store)) ?
+ modest_tny_folder_get_account (TNY_FOLDER (priv->cur_folder_store)) :
+ TNY_ACCOUNT (g_object_ref (priv->cur_folder_store));
+ if (account == folder_selected_account)
+ modest_folder_view_select_first_inbox_or_local (self);
+ g_object_unref (folder_selected_account);
+ }