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),
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;
}
* 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;
* 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: