* Reverted some changes from one of the latest armin's commits. We can never call...
authorSergio Villar Senin <svillar@igalia.com>
Mon, 23 Jul 2007 10:18:00 +0000 (10:18 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Mon, 23 Jul 2007 10:18:00 +0000 (10:18 +0000)
pmo-trunk-r2768

src/maemo/modest-msg-view-window.c
src/modest-ui-actions.c

index 3a5f47e..b136be5 100644 (file)
@@ -1589,17 +1589,22 @@ on_account_removed (ModestAccountMgr *mgr,
                    gboolean server_account,
                    gpointer user_data)
 {
-       ModestTnyAccountStore *store = modest_runtime_get_account_store ();
-       const gchar *our_acc = modest_window_get_active_account (MODEST_WINDOW (user_data));
+       ModestTnyAccountStore *store;
+       const gchar *our_acc;
+       TnyAccount *tny_acc;
 
-       TnyAccount *tny_acc = modest_tny_account_store_get_tny_account_by (store, MODEST_TNY_ACCOUNT_STORE_QUERY_ID, account);
-       if(tny_acc != NULL)
-       {
-               const gchar* parent_acc = modest_tny_account_get_parent_modest_account_name_for_server_account (tny_acc);
+       store = modest_runtime_get_account_store ();
+       our_acc = modest_window_get_active_account (MODEST_WINDOW (user_data));
+       tny_acc = modest_tny_account_store_get_tny_account_by (store, 
+                                                              MODEST_TNY_ACCOUNT_STORE_QUERY_ID, 
+                                                              account);
+
+
+       if(tny_acc != NULL) {
+               const gchar* parent_acc = 
+                       modest_tny_account_get_parent_modest_account_name_for_server_account (tny_acc);
                if (strcmp (parent_acc, our_acc) == 0)
-               {
-                       gtk_widget_destroy (GTK_WIDGET (user_data));
-               }
+                       modest_ui_actions_on_close_window (NULL, MODEST_WINDOW (user_data));
        }
 }
 
index 31b85d8..879540d 100644 (file)
@@ -467,6 +467,7 @@ void
 modest_ui_actions_on_close_window (GtkAction *action, ModestWindow *win)
 {
        gboolean ret_value;
+
        g_signal_emit_by_name (G_OBJECT (win), "delete-event", NULL, &ret_value);
 
 /*     if (MODEST_IS_MSG_VIEW_WINDOW (win)) { */