2007-06-26 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Tue, 26 Jun 2007 09:10:53 +0000 (09:10 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Tue, 26 Jun 2007 09:10:53 +0000 (09:10 +0000)
* src/modest-init.c: (modest_init_local_folders):
        For memory-card (or other non local-folders) maildir accounts,
        always create an Archive folder, so that there is somewhere to put
        messages. This should be less confusing, because the user does not need
        to guess that the need to create a folder.

pmo-trunk-r2420

ChangeLog2
src/modest-init.c

index 551133e..4e42389 100644 (file)
@@ -1,3 +1,11 @@
+2007-06-26  Murray Cumming  <murrayc@murrayc.com>
+
+       * src/modest-init.c: (modest_init_local_folders):
+       For memory-card (or other non local-folders) maildir accounts, 
+       always create an Archive folder, so that there is somewhere to put 
+       messages. This should be less confusing, because the user does not need 
+       to guess that the need to create a folder.
+
 2007-06-25  Johannes Schmid <johannes.schmid@openismus.com>
 
        * src/maemo/easysetup/modest-wizard-dialog.c: (init):
index 2217eb1..706c0e4 100644 (file)
@@ -431,15 +431,31 @@ gboolean modest_init_one_local_folder (gchar *maildir_path)
 gboolean
 modest_init_local_folders (const gchar* location_filepath)
 {      
+       gboolean retval = TRUE;
+
        gchar *maildir_path = modest_local_folder_info_get_maildir_path (location_filepath);
 
        if (location_filepath) {
-               /* For instance, for memory card, just create the top-level .modest folder: */
+               /* For instance, for memory card, just create the top-level .modest folder
+                * and one "archive" folder (so that messages can be put somewhere):
+                */
+
+               gchar *dir = g_build_filename (maildir_path,
+                               "Archive", NULL);                       
+               const gboolean created = modest_init_one_local_folder (dir);
+               g_free(dir);
+                       
+               if (!created) {
+                       retval = FALSE;
+               }
+
+               #if 0
+               /* Do this if we only create the top-level dir: */
                if (g_mkdir_with_parents (maildir_path, 0755) < 0) {
                        g_printerr ("modest: %s: failed to create %s\n", __FUNCTION__, location_filepath);
-                       g_free (maildir_path);
-                       return FALSE;
+                       retval = FALSE;
                }
+               #endif
        }
        else {
                /* Create each of the standard on-disk folders.
@@ -453,14 +469,13 @@ modest_init_local_folders (const gchar* location_filepath)
                        g_free(dir);
                        
                        if (!created) {
-                               g_free (maildir_path);
-                               return FALSE;
+                               retval = FALSE;
                        }
                }
        }
        
        g_free (maildir_path);
-       return TRUE;
+       return retval;
 }
 
 /**