* Fixes NB#86171, show the proper error banner when account could not connect due...
[modest] / src / modest-tny-account-store.c
index 540446c..3f3cc66 100644 (file)
@@ -312,9 +312,6 @@ account_verify_last_ref (TnyAccount *account, const gchar *str)
        g_free (txt);
 }
 
-
-
-
 static void
 foreach_account_append_to_list (gpointer data, 
                                gpointer user_data)
@@ -511,16 +508,8 @@ show_wrong_password_dialog (TnyAccount *account)
 { 
        /* This is easier than using a struct for the user_data: */
        ModestTnyAccountStore *self = modest_runtime_get_account_store();
-       GtkWidget *main_window;
        GtkWidget *dialog = NULL;
 
-       main_window = (GtkWidget *) modest_window_mgr_get_main_window (modest_runtime_get_window_mgr (),
-                                                                      FALSE); /* don't create */
-       if (!main_window) {
-               g_warning ("%s: password was wrong; ignoring because no main window", __FUNCTION__);
-               return;
-       }
-
        if (g_object_get_data (G_OBJECT (account), "connection_specific") != NULL) {
                modest_ui_actions_on_smtp_servers (NULL, NULL);
        } else {
@@ -844,8 +833,6 @@ modest_tny_account_store_finalize (GObject *obj)
                priv->session = NULL;
        }
 
-       camel_shutdown ();
-       
        G_OBJECT_CLASS(parent_class)->finalize (obj);
 }
 
@@ -2045,10 +2032,10 @@ remove_connection_specific_transport_accounts (ModestTnyAccountStore *self)
                        account = modest_tny_account_store_get_server_account (self,
                                                                               transport_account_name,
                                                                               TNY_ACCOUNT_TYPE_TRANSPORT);
-                       if (account) {
+
+                       /* the call will free the reference */
+                       if (account)
                                remove_transport_account (self, TNY_TRANSPORT_ACCOUNT (account));
-                               g_object_unref (account);
-                       }
                }                               
                iter = g_slist_next (iter);
        }