aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-17 13:38:30 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-17 13:38:30 +0800
commitf01f470467198a6a5ccc619dac508e8bf7c07d9e (patch)
treede38e33084e8543d6a25cbc36c3fa60e9fe1ccf1
parent696ef2d4f12eb0a40a7fcc25066e2a85f9da87f2 (diff)
downloadgsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.gz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.bz2
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.lz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.xz
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.zst
gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.zip
** Bug #56050.
2004-05-17 Not Zed <NotZed@Ximian.com> ** Bug #56050. * providers/imap/camel-imap-store.c (imap_get_trash) (imap_get_junk): similar to below. * providers/local/camel-local-store.c (local_get_trash) (local_get_junk): set state file on trash/junk to something we know about. svn path=/trunk/; revision=25918
-rw-r--r--camel/ChangeLog10
-rw-r--r--camel/providers/imap/camel-imap-store.c39
-rw-r--r--camel/providers/local/camel-local-store.c44
3 files changed, 90 insertions, 3 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 78280f3daa..3f170b2d74 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,15 @@
2004-05-17 Not Zed <NotZed@Ximian.com>
+ ** Bug #56050.
+
+ * providers/imap/camel-imap-store.c (imap_get_trash)
+ (imap_get_junk): similar to below.
+
+ * providers/local/camel-local-store.c (local_get_trash)
+ (local_get_junk): set state file on trash/junk to something we know
+ about.
+
+2004-05-17 Not Zed <NotZed@Ximian.com>
* providers/local/camel-mh-store.c (fill_fi): if we have no folder
in-memory, load it if we're not doing it fast to get really up to
date unread counts. #57616.
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index da4a57b255..b669398697 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -90,11 +90,14 @@ static gboolean imap_connect_offline (CamelService *service, CamelException *ex)
static gboolean imap_disconnect_online (CamelService *service, gboolean clean, CamelException *ex);
static gboolean imap_disconnect_offline (CamelService *service, gboolean clean, CamelException *ex);
static void imap_noop (CamelStore *store, CamelException *ex);
+static CamelFolder *imap_get_junk(CamelStore *store, CamelException *ex);
+static CamelFolder *imap_get_trash(CamelStore *store, CamelException *ex);
static GList *query_auth_types (CamelService *service, CamelException *ex);
static guint hash_folder_name (gconstpointer key);
static gint compare_folder_name (gconstpointer a, gconstpointer b);
static CamelFolder *get_folder_online (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
static CamelFolder *get_folder_offline (CamelStore *store, const char *folder_name, guint32 flags, CamelException *ex);
+
static CamelFolderInfo *create_folder (CamelStore *store, const char *parent_name, const char *folder_name, CamelException *ex);
static void delete_folder (CamelStore *store, const char *folder_name, CamelException *ex);
static void rename_folder (CamelStore *store, const char *old_name, const char *new_name, CamelException *ex);
@@ -153,6 +156,8 @@ camel_imap_store_class_init (CamelImapStoreClass *camel_imap_store_class)
camel_store_class->subscribe_folder = subscribe_folder;
camel_store_class->unsubscribe_folder = unsubscribe_folder;
camel_store_class->noop = imap_noop;
+ camel_store_class->get_trash = imap_get_trash;
+ camel_store_class->get_junk = imap_get_junk;
camel_disco_store_class->can_work_offline = can_work_offline;
camel_disco_store_class->connect_online = imap_connect_online;
@@ -1632,6 +1637,40 @@ imap_noop (CamelStore *store, CamelException *ex)
CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
}
+static CamelFolder *
+imap_get_trash(CamelStore *store, CamelException *ex)
+{
+ CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex);
+
+ if (folder) {
+ char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Trash.cmeta", NULL);
+
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
+ g_free(state);
+ /* no defaults? */
+ camel_object_state_read(folder);
+ }
+
+ return folder;
+}
+
+static CamelFolder *
+imap_get_junk(CamelStore *store, CamelException *ex)
+{
+ CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex);
+
+ if (folder) {
+ char *state = g_build_filename(((CamelImapStore *)store)->storage_path, "system", "Junk.cmeta", NULL);
+
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
+ g_free(state);
+ /* no defaults? */
+ camel_object_state_read(folder);
+ }
+
+ return folder;
+}
+
static guint
hash_folder_name (gconstpointer key)
{
diff --git a/camel/providers/local/camel-local-store.c b/camel/providers/local/camel-local-store.c
index a009000f78..2a154d1556 100644
--- a/camel/providers/local/camel-local-store.c
+++ b/camel/providers/local/camel-local-store.c
@@ -50,7 +50,9 @@
static void construct (CamelService *service, CamelSession *session, CamelProvider *provider, CamelURL *url, CamelException *ex);
static CamelFolder *get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelException * ex);
static char *get_name(CamelService *service, gboolean brief);
-static CamelFolder *get_inbox (CamelStore *store, CamelException *ex);
+static CamelFolder *local_get_inbox (CamelStore *store, CamelException *ex);
+static CamelFolder *local_get_junk(CamelStore *store, CamelException *ex);
+static CamelFolder *local_get_trash(CamelStore *store, CamelException *ex);
static CamelFolderInfo *get_folder_info (CamelStore *store, const char *top, guint32 flags, CamelException *ex);
static void delete_folder(CamelStore *store, const char *folder_name, CamelException *ex);
static void rename_folder(CamelStore *store, const char *old, const char *new, CamelException *ex);
@@ -70,7 +72,9 @@ camel_local_store_class_init (CamelLocalStoreClass *camel_local_store_class)
camel_service_class->construct = construct;
camel_service_class->get_name = get_name;
camel_store_class->get_folder = get_folder;
- camel_store_class->get_inbox = get_inbox;
+ camel_store_class->get_inbox = local_get_inbox;
+ camel_store_class->get_trash = local_get_trash;
+ camel_store_class->get_junk = local_get_junk;
camel_store_class->get_folder_info = get_folder_info;
camel_store_class->free_folder_info = camel_store_free_folder_info_full;
@@ -168,13 +172,47 @@ get_folder(CamelStore * store, const char *folder_name, guint32 flags, CamelExce
}
static CamelFolder *
-get_inbox(CamelStore *store, CamelException *ex)
+local_get_inbox(CamelStore *store, CamelException *ex)
{
camel_exception_set(ex, CAMEL_EXCEPTION_STORE_NO_FOLDER,
_("Local stores do not have an inbox"));
return NULL;
}
+static CamelFolder *
+local_get_trash(CamelStore *store, CamelException *ex)
+{
+ CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_trash(store, ex);
+
+ if (folder) {
+ char *state = g_build_filename(((CamelLocalStore *)store)->toplevel_dir, ".Trash.cmeta", NULL);
+
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
+ g_free(state);
+ /* no defaults? */
+ camel_object_state_read(folder);
+ }
+
+ return folder;
+}
+
+static CamelFolder *
+local_get_junk(CamelStore *store, CamelException *ex)
+{
+ CamelFolder *folder = CAMEL_STORE_CLASS(parent_class)->get_junk(store, ex);
+
+ if (folder) {
+ char *state = g_build_filename(((CamelLocalStore *)store)->toplevel_dir, ".Junk.cmeta", NULL);
+
+ camel_object_set(folder, NULL, CAMEL_OBJECT_STATE_FILE, state, NULL);
+ g_free(state);
+ /* no defaults? */
+ camel_object_state_read(folder);
+ }
+
+ return folder;
+}
+
static char *
get_name (CamelService *service, gboolean brief)
{