* Added modest_platform_create_folder_view
[modest] / src / widgets / modest-folder-view.c
index d95c3a6..e86574f 100644 (file)
@@ -43,6 +43,7 @@
 #include <tny-simple-list.h>
 #include <modest-tny-folder.h>
 #include <modest-tny-local-folders-account.h>
+#include <modest-tny-outbox-account.h>
 #include <modest-marshal.h>
 #include <modest-icon-names.h>
 #include <modest-tny-account-store.h>
@@ -729,6 +730,11 @@ filter_row (GtkTreeModel *model,
                                if (priv->visible_account_id && strcmp (account_id, priv->visible_account_id))
                                        retval = FALSE;
                        }
+                       
+                       /* Never show these to the user. They are merged into one folder 
+                        * in the local-folders account instead: */
+                       if (retval && MODEST_IS_TNY_OUTBOX_ACCOUNT (acc))
+                               retval = FALSE;
                }
        }
        
@@ -803,6 +809,9 @@ modest_folder_view_update_model (ModestFolderView *self,
                g_object_unref (filter_model);
                        
        g_object_unref (sortable);
+
+       /* Select the first inbox or the local account if not found */
+       modest_folder_view_select_first_inbox_or_local (self);
                        
        return TRUE;
 }
@@ -1654,8 +1663,6 @@ find_inbox_iter (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *inbox_iter
        return FALSE;
 }
 
-
-
 void 
 modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
 {
@@ -1663,6 +1670,10 @@ modest_folder_view_select_first_inbox_or_local (ModestFolderView *self)
        GtkTreeIter iter, inbox_iter;
        GtkTreeSelection *sel;
 
+       /* Do not set it if the folder view was not painted */
+       if (!GTK_WIDGET_MAPPED (self))
+               return; 
+
        model = gtk_tree_view_get_model (GTK_TREE_VIEW (self));
        if (!model)
                return;