Preserver headers of messages in drafts and sending messages.
[modest] / src / hildon2 / modest-folder-window.c
index 3b7604a..c4a283a 100644 (file)
@@ -28,8 +28,6 @@
  */
 
 #include <modest-folder-window.h>
-#include <modest-osso-state-saving.h>
-#include <libosso.h>
 #include <hildon/hildon-pannable-area.h>
 #include <modest-window-mgr.h>
 #include <modest-signal-mgr.h>
@@ -246,7 +244,13 @@ modest_folder_window_dispose (GObject *obj)
                        }
                        g_object_unref (iter);
                }
+
+               if (list && TNY_IS_GTK_FOLDER_LIST_STORE (list)) {
+                       g_object_run_dispose (G_OBJECT (list));
+               }
+
                g_object_unref (list);
+               priv->folder_view = NULL;
        }       
 
        G_OBJECT_CLASS(parent_class)->dispose (obj);
@@ -380,10 +384,6 @@ modest_folder_window_new (TnyFolderStoreQuery *query)
 
        connect_signals (MODEST_FOLDER_WINDOW (self));
 
-       /* Load previous osso state, for instance if we are being restored from 
-        * hibernation:  */
-       modest_osso_load_state ();
-
        /* Get device name */
        modest_maemo_utils_get_device_name ();
 
@@ -531,11 +531,14 @@ edit_account (GtkButton *button,
                if (proto && MODEST_IS_ACCOUNT_PROTOCOL (proto)) {
                        ModestAccountSettingsDialog *dialog =
                                modest_account_protocol_get_account_settings_dialog (proto, account_name);
-                       modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
-                                                    (GtkWindow *) dialog,
-                                                    (GtkWindow *) self);
-                       gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE);
-                       gtk_widget_show (GTK_WIDGET (dialog));
+
+                       if (dialog) {
+                               modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+                                                            (GtkWindow *) dialog,
+                                                            (GtkWindow *) self);
+                               gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), FALSE);
+                               gtk_widget_show (GTK_WIDGET (dialog));
+                       }
                }
        }
 }
@@ -549,6 +552,9 @@ setup_menu (ModestFolderWindow *self)
        modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_new_folder"), NULL,
                                           APP_MENU_CALLBACK (modest_ui_actions_on_new_folder),
                                           NULL);
+       modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"), NULL,
+                                          APP_MENU_CALLBACK (modest_ui_actions_on_send_receive),
+                                          MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_send_receive));
        modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_rename_folder"), NULL,
                                           APP_MENU_CALLBACK (set_rename_edit_mode),
                                           MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_rename_folder));
@@ -559,11 +565,6 @@ setup_menu (ModestFolderWindow *self)
                                           APP_MENU_CALLBACK (set_delete_edit_mode),
                                           MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_folder_window_delete));
 
-       /* send receive actions should be only one visible always */
-       modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_inbox_sendandreceive"), NULL,
-                                          APP_MENU_CALLBACK (modest_ui_actions_on_send_receive),
-                                          MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_send_receive));
-
        modest_hildon2_window_add_to_menu (MODEST_HILDON2_WINDOW (self), _("mcen_me_outbox_cancelsend"), NULL,
                                           APP_MENU_CALLBACK (modest_ui_actions_cancel_send),
                                           MODEST_DIMMING_CALLBACK (modest_ui_dimming_rules_on_cancel_sending_all));