From: Murray Cumming Date: Wed, 13 Jun 2007 13:46:12 +0000 (+0000) Subject: 2007-06-13 Murray Cumming X-Git-Tag: git_migration_finished~3303 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=562919f14c59960fe7425e2ed19c03eff73a4ace 2007-06-13 Murray Cumming * 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 --- diff --git a/ChangeLog2 b/ChangeLog2 index 3d85fe2..8f761ae 100644 --- a/ChangeLog2 +++ b/ChangeLog2 @@ -1,5 +1,16 @@ 2007-06-13 Murray Cumming + * 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 + * libmodest-dbus-client/libmodest-dbus-client.c: (libmodest_dbus_client_send_mail), (libmodest_dbus_client_mail_to), (libmodest_dbus_client_compose_mail), diff --git a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in b/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in index 00245ee..930b644 100644 --- a/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in +++ b/libmodest-dbus-client/libmodest-dbus-client-1.0.pc.in @@ -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 diff --git a/src/modest-init.c b/src/modest-init.c index 56ffe53..b7169ca 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -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; diff --git a/src/modest-init.h b/src/modest-init.h index ee312af..0503c84 100644 --- a/src/modest-init.h +++ b/src/modest-init.h @@ -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: