diff options
author | Milan Crha <mcrha@redhat.com> | 2011-09-26 18:13:20 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-09-26 18:56:08 +0800 |
commit | 34f19df86518cd0d8f6bb5437ba989997564f20d (patch) | |
tree | 3388c14ca932d7c27bdf5ddc5d4057303b99b918 | |
parent | d230dd72bb6aff738974ccaa91bfad5d321e9c0c (diff) | |
download | gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar.gz gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar.bz2 gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar.lz gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar.xz gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.tar.zst gsoc2013-evolution-34f19df86518cd0d8f6bb5437ba989997564f20d.zip |
Bug #656473 - Store server folder cache in user's cache directory
-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 |