* Partially fixes NB#85461, do not unload the folder before synchronizing it
authorSergio Villar Senin <svillar@igalia.com>
Wed, 21 May 2008 07:31:27 +0000 (07:31 +0000)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 21 May 2008 07:31:27 +0000 (07:31 +0000)
pmo-trunk-r4549

src/widgets/modest-folder-view.c
src/widgets/modest-header-view.c

index e04d468..da8e834 100644 (file)
@@ -1465,14 +1465,18 @@ on_selection_changed (GtkTreeSelection *sel, gpointer user_data)
        
        /* Current folder was unselected */
        if (priv->cur_folder_store) {
-               g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,
-                      priv->cur_folder_store, FALSE);
-
+               /* We must do this firstly because a libtinymail-camel
+                  implementation detail. If we issue the signal
+                  before doing the sync_async, then that signal could
+                  cause (and it actually does it) a free of the
+                  summary of the folder (because the main window will
+                  clear the headers view */
                if (TNY_IS_FOLDER(priv->cur_folder_store))
                        tny_folder_sync_async (TNY_FOLDER(priv->cur_folder_store),
                                               FALSE, NULL, NULL, NULL);
 
-               /* FALSE --> don't expunge the messages */
+               g_signal_emit (G_OBJECT(tree_view), signals[FOLDER_SELECTION_CHANGED_SIGNAL], 0,
+                      priv->cur_folder_store, FALSE);
 
                g_object_unref (priv->cur_folder_store);
                priv->cur_folder_store = NULL;
index 2df0fd7..aeddf0c 100644 (file)
@@ -1268,8 +1268,10 @@ modest_header_view_set_folder (ModestHeaderView *self,
        }
                                                      
        if (priv->folder) {
-               if (priv->status_timeout)
+               if (priv->status_timeout) {
                        g_source_remove (priv->status_timeout);
+                       priv->status_timeout = 0;
+               }
 
                g_mutex_lock (priv->observers_lock);
                tny_folder_remove_observer (priv->folder, TNY_FOLDER_OBSERVER (self));
@@ -1989,6 +1991,10 @@ static void
 notify_filter_change_destroy (gpointer data)
 {
        NotifyFilterInfo *info = (NotifyFilterInfo *) data;
+       ModestHeaderViewPrivate *priv;
+
+       priv = MODEST_HEADER_VIEW_GET_PRIVATE (info->self);
+       priv->status_timeout = 0;
 
        g_object_unref (info->self);
        g_object_unref (info->folder);