[evolution] Bug #656473 - Store server folder cache in user's cache directory
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Bug #656473 - Store server folder cache in user's cache directory
- Date: Mon, 26 Sep 2011 10:13:42 +0000 (UTC)
commit f579563b058cfc099ebf858b2ef096d5e61bda92
Author: Milan Crha <mcrha redhat com>
Date: Mon Sep 26 12:13:20 2011 +0200
Bug #656473 - Store server folder cache in user's cache directory
mail/e-mail-session.c | 17 ++++++++++++++++-
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 7addaec..7ed8720 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 653404c..165b335 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]