2007-06-13 Murray Cumming <murrayc@murrayc.com>
authorMurray Cumming <murrayc@murrayc.com>
Wed, 13 Jun 2007 13:46:12 +0000 (13:46 +0000)
committerMurray Cumming <murrayc@murrayc.com>
Wed, 13 Jun 2007 13:46:12 +0000 (13:46 +0000)
* libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in:
Remove unnecessary lib/include, though it is good in principle when needed.

* src/modest-init.c: (modest_init_one_local_folder),
(modest_init_local_folders):
* src/modest-init.h: Initialize the .modest library for memory cards,
instead of just doing nothing for them. This should allow us to create
folders there, fixing projects.maemo.org bug NB#59297.

pmo-trunk-r2208

ChangeLog2
libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in
src/modest-init.c
src/modest-init.h

index 3d85fe2..8f761ae 100644 (file)
@@ -1,5 +1,16 @@
 2007-06-13  Murray Cumming  <murrayc@murrayc.com>
 
+       * libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in:
+       Remove unnecessary lib/include, though it is good in principle when needed.
+       
+       * src/modest-init.c: (modest_init_one_local_folder),
+       (modest_init_local_folders):
+       * src/modest-init.h: Initialize the .modest library for memory cards, 
+       instead of just doing nothing for them. This should allow us to create 
+       folders there, fixing projects.maemo.org bug NB#59297.
+
+2007-06-13  Murray Cumming  <murrayc@murrayc.com>
+
        * libmodest-dbus-client/libmodest-dbus-client.c:
        (libmodest_dbus_client_send_mail), (libmodest_dbus_client_mail_to),
        (libmodest_dbus_client_compose_mail),
index 00245ee..930b644 100644 (file)
@@ -8,4 +8,4 @@ Description: Some library.
 Requires: glib-2.0 dbus-1
 Version: @VERSION@
 Libs: -L${libdir} -lmodest-dbus-client-1.0
-Cflags: -I${includedir}/libmodest-dbus-client-1.0 -I${libdir}/libmodest-dbus-client-1.0/include
+Cflags: -I${includedir}/libmodest-dbus-client-1.0
index 56ffe53..b7169ca 100644 (file)
@@ -323,7 +323,7 @@ gboolean modest_init_one_local_folder (gchar *maildir_path)
                                        maildirs[j],
                                        NULL);
                if (g_mkdir_with_parents (dir, 0755) < 0) {
-                       g_printerr ("modest: failed to create %s\n", dir);
+                       g_printerr ("modest: %s: failed to create %s\n", __FUNCTION__, dir);
                        g_free (dir);
                        return FALSE;
                }
@@ -344,25 +344,35 @@ gboolean modest_init_one_local_folder (gchar *maildir_path)
  * they were created, FALSE otherwise
  */
 gboolean
-modest_init_local_folders  ()
+modest_init_local_folders (const gchar* location_filepath)
 {      
-       gchar *maildir_path = modest_local_folder_info_get_maildir_path (NULL);
+       gchar *maildir_path = modest_local_folder_info_get_maildir_path (location_filepath);
 
-       /* Create each of the standard on-disk folders.
-        * Per-account outbox folders will be created when first needed. */
-       int i;
-       for (i = 0; i != G_N_ELEMENTS(LOCAL_FOLDERS); ++i) {
-               gchar *dir = g_build_filename (maildir_path,
-                                               modest_local_folder_info_get_type_name(LOCAL_FOLDERS[i]),
-                                               NULL);                  
-               const gboolean created = modest_init_one_local_folder (dir);
-               g_free(dir);
-               
-               if (!created) {
+       if (location_filepath) {
+               /* For instance, for memory card, just create the top-level .modest folder: */
+               if (g_mkdir_with_parents (maildir_path, 0755) < 0) {
+                       g_printerr ("modest: %s: failed to create %s\n", __FUNCTION__, dir);
                        g_free (maildir_path);
                        return FALSE;
                }
        }
+       else {
+               /* Create each of the standard on-disk folders.
+                * Per-account outbox folders will be created when first needed. */
+               int i;
+               for (i = 0; i != G_N_ELEMENTS(LOCAL_FOLDERS); ++i) {
+                       gchar *dir = g_build_filename (maildir_path,
+                                                       modest_local_folder_info_get_type_name(LOCAL_FOLDERS[i]),
+                                                       NULL);                  
+                       const gboolean created = modest_init_one_local_folder (dir);
+                       g_free(dir);
+                       
+                       if (!created) {
+                               g_free (maildir_path);
+                               return FALSE;
+                       }
+               }
+       }
        
        g_free (maildir_path);
        return TRUE;
index ee312af..0503c84 100644 (file)
@@ -80,7 +80,7 @@ gboolean modest_init_uninit (void);
  * Returns: TRUE if the folder were already there, or
  * they were created, FALSE otherwise
  */
-gboolean modest_init_local_folders  ();
+gboolean modest_init_local_folders  (const gchar* location_filepath);
 
 /**
  * modest_init_one_local_folder: