X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-local-folder-info.c;h=9c646a73b5be420fa2fbb550199fbf92cdcac39f;hb=856d7ab2997effafe72148fe34a0aa461856ce07;hp=c1956b41dbf39fd8e916713de81537523a89e5f2;hpb=50533dff2af0ce1a0d891f7034bd8749670c8e14;p=modest diff --git a/src/modest-local-folder-info.c b/src/modest-local-folder-info.c index c1956b4..9c646a7 100644 --- a/src/modest-local-folder-info.c +++ b/src/modest-local-folder-info.c @@ -30,6 +30,7 @@ #include #include /* strcmp */ #include +#include typedef struct { TnyFolderType type; @@ -48,8 +49,10 @@ const ModestLocalFolder ModestLocalFolderMap[] = { { TNY_FOLDER_TYPE_ROOT, "", N_("")}, { TNY_FOLDER_TYPE_NOTES, "notes", N_("Notes")}, { TNY_FOLDER_TYPE_DRAFTS, "drafts", N_("mcen_me_folder_drafts")}, - { TNY_FOLDER_TYPE_OUTBOX, "contacts", N_("Contacts")}, +/* TODO: Do we want these? If so, they need a type ID: + * { TNY_FOLDER_TYPE_OUTBOX, "contacts", N_("Contacts")}, { TNY_FOLDER_TYPE_OUTBOX, "calendar", N_("Calendar")}, +*/ { TNY_FOLDER_TYPE_ARCHIVE, "archive", N_("Archive")} }; @@ -102,11 +105,37 @@ modest_local_folder_info_get_type_display_name (TnyFolderType type) gchar * -modest_local_folder_info_get_maildir_path (void) +modest_local_folder_info_get_maildir_path (const gchar* location_filepath) { - return g_build_filename (g_get_home_dir(), + return g_build_filename (location_filepath ? location_filepath : g_get_home_dir(), MODEST_DIR, MODEST_LOCAL_FOLDERS_MAILDIR, NULL); } +gchar *modest_per_account_local_outbox_folder_info_get_maildir_path (const gchar* account_name) +{ + /* This directory should contain an "outbox" child directory: */ + return g_build_filename (g_get_home_dir(), + MODEST_DIR, + MODEST_PER_ACCOUNT_LOCAL_OUTBOX_FOLDERS_MAILDIR, + account_name, + NULL); +} + +gchar *modest_per_account_local_outbox_folder_info_get_maildir_path_to_outbox_folder (const gchar* account_name) +{ + gchar *path_to_account_folder = + modest_per_account_local_outbox_folder_info_get_maildir_path(account_name); + if (!path_to_account_folder) + return NULL; + + gchar *path = g_build_filename (path_to_account_folder, "outbox", NULL); + + g_free (path_to_account_folder); + + return path; +} + + +