diff options
author | Not Zed <NotZed@Ximian.com> | 2004-05-17 13:38:30 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-05-17 13:38:30 +0800 |
commit | f01f470467198a6a5ccc619dac508e8bf7c07d9e (patch) | |
tree | de38e33084e8543d6a25cbc36c3fa60e9fe1ccf1 /camel/providers/local/camel-local-store.c | |
parent | 696ef2d4f12eb0a40a7fcc25066e2a85f9da87f2 (diff) | |
download | gsoc2013-evolution-f01f470467198a6a5ccc619dac508e8bf7c07d9e.tar.gz 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
Diffstat (limited to 'camel/providers/local/camel-local-store.c')
-rw-r--r-- | camel/providers/local/camel-local-store.c | 44 |
1 files changed, 41 insertions, 3 deletions
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) { |