diff options
-rw-r--r-- | mail/e-mail-session.c | 17 | ||||
-rw-r--r-- | mail/e-mail-session.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index 7addaece4a..7ed8720e75 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -101,6 +101,7 @@ enum { }; static gchar *mail_data_dir; +static gchar *mail_cache_dir; static gchar *mail_config_dir; #if 0 @@ -1220,12 +1221,16 @@ EMailSession * e_mail_session_new (void) { const gchar *user_data_dir; + const gchar *user_cache_dir; user_data_dir = mail_session_get_data_dir (); + user_cache_dir = mail_session_get_cache_dir (); return g_object_new ( E_TYPE_MAIL_SESSION, - "user-data-dir", user_data_dir, NULL); + "user-data-dir", user_data_dir, + "user-cache-dir", user_cache_dir, + NULL); } MailFolderCache * @@ -1601,6 +1606,16 @@ mail_session_get_data_dir (void) } const gchar * +mail_session_get_cache_dir (void) +{ + if (G_UNLIKELY (mail_cache_dir == NULL)) + mail_cache_dir = g_build_filename ( + e_get_user_cache_dir (), "mail", NULL); + + return mail_cache_dir; +} + +const gchar * mail_session_get_config_dir (void) { if (G_UNLIKELY (mail_config_dir == NULL)) diff --git a/mail/e-mail-session.h b/mail/e-mail-session.h index 653404ca7a..165b335a19 100644 --- a/mail/e-mail-session.h +++ b/mail/e-mail-session.h @@ -116,6 +116,7 @@ CamelFolder * e_mail_session_uri_to_folder_finish void mail_session_flush_filter_log (EMailSession *session); const gchar * mail_session_get_data_dir (void); +const gchar * mail_session_get_cache_dir (void); const gchar * mail_session_get_config_dir (void); G_END_DECLS |