diff options
author | Jeffrey Stedfast <fejj@novell.com> | 2004-11-10 05:04:25 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-11-10 05:04:25 +0800 |
commit | 34172c778d5abe57925476687a6791efec095430 (patch) | |
tree | 3b28769da6ebb67e77b44f61ab1ed33b33d671f9 /camel | |
parent | af76723198b24e09a703545301120c09c50fe346 (diff) | |
download | gsoc2013-evolution-34172c778d5abe57925476687a6791efec095430.tar.gz gsoc2013-evolution-34172c778d5abe57925476687a6791efec095430.tar.zst gsoc2013-evolution-34172c778d5abe57925476687a6791efec095430.zip |
Updated the properties to include all the same settings as the old imap
2004-11-09 Jeffrey Stedfast <fejj@novell.com>
* providers/imap4/camel-imap4-provider.c: Updated the properties
to include all the same settings as the old imap code.
* providers/imap4/camel-imap4-folder.c (imap4_getv): Implemented.
(imap4_setv): Implemented.
svn path=/trunk/; revision=27880
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/imap4/camel-imap4-folder.c | 91 | ||||
-rw-r--r-- | camel/providers/imap4/camel-imap4-folder.h | 12 | ||||
-rw-r--r-- | camel/providers/imap4/camel-imap4-provider.c | 10 |
4 files changed, 121 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index ab9a878995..b0c412f23a 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2004-11-09 Jeffrey Stedfast <fejj@novell.com> + + * providers/imap4/camel-imap4-provider.c: Updated the properties + to include all the same settings as the old imap code. + + * providers/imap4/camel-imap4-folder.c (imap4_getv): Implemented. + (imap4_setv): Implemented. + 2004-11-08 Jeffrey Stedfast <fejj@novell.com> Fix for bug #69241. diff --git a/camel/providers/imap4/camel-imap4-folder.c b/camel/providers/imap4/camel-imap4-folder.c index 1b48ef7234..6c989b6908 100644 --- a/camel/providers/imap4/camel-imap4-folder.c +++ b/camel/providers/imap4/camel-imap4-folder.c @@ -55,10 +55,19 @@ #define d(x) x +static GSList *imap4_folder_props = NULL; + +static CamelProperty imap4_prop_list[] = { + { CAMEL_IMAP4_FOLDER_SYNC_OFFLINE, "sync_offline", N_("Copy folder content locally for offline operation") }, +}; + static void camel_imap4_folder_class_init (CamelIMAP4FolderClass *klass); static void camel_imap4_folder_init (CamelIMAP4Folder *folder, CamelIMAP4FolderClass *klass); static void camel_imap4_folder_finalize (CamelObject *object); +static int imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args); +static int imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args); + static void imap4_sync (CamelFolder *folder, gboolean expunge, CamelException *ex); static void imap4_refresh_info (CamelFolder *folder, CamelException *ex); static void imap4_expunge (CamelFolder *folder, CamelException *ex); @@ -98,9 +107,19 @@ static void camel_imap4_folder_class_init (CamelIMAP4FolderClass *klass) { CamelFolderClass *folder_class = (CamelFolderClass *) klass; + CamelObjectClass *object_class = (CamelObjectClass *) klass; + int i; parent_class = (CamelFolderClass *) camel_type_get_global_classfuncs (CAMEL_FOLDER_TYPE); + for (i = 0; i < G_N_ELEMENTS (imap4_prop_list); i++) { + imap4_prop_list[i].description = _(imap4_prop_list[i].description); + imap4_folder_props = g_slist_prepend (imap4_folder_props, &imap4_prop_list[i]); + } + + object_class->getv = imap4_getv; + object_class->setv = imap4_setv; + folder_class->sync = imap4_sync; folder_class->refresh_info = imap4_refresh_info; folder_class->expunge = imap4_expunge; @@ -117,6 +136,7 @@ camel_imap4_folder_init (CamelIMAP4Folder *folder, CamelIMAP4FolderClass *klass) { ((CamelFolder *) folder)->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY | CAMEL_FOLDER_HAS_SEARCH_CAPABILITY; + folder->sync_offline = FALSE; folder->utf7_name = NULL; folder->cachedir = NULL; folder->search = NULL; @@ -136,6 +156,77 @@ camel_imap4_folder_finalize (CamelObject *object) g_free (folder->cachedir); } +static int +imap4_getv (CamelObject *object, CamelException *ex, CamelArgGetV *args) +{ + CamelArgGetV props; + int i, count = 0; + guint32 tag; + + for (i = 0; i <args->argc; i++) { + CamelArgGet *arg = &args->argv[i]; + + tag = arg->tag; + + switch (tag & CAMEL_ARG_TAG) { + case CAMEL_OBJECT_ARG_PERSISTENT_PROPERTIES: + case CAMEL_FOLDER_ARG_PROPERTIES: + props.argc = 1; + props.argv[0] = *arg; + ((CamelObjectClass *) parent_class)->getv (object, ex, &props); + *arg->ca_ptr = g_slist_concat (*arg->ca_ptr, g_slist_copy (imap4_folder_props)); + break; + case CAMEL_IMAP4_FOLDER_ARG_SYNC_OFFLINE: + *arg->ca_int = ((CamelIMAP4Folder *) object)->sync_offline; + break; + default: + count++; + continue; + } + + arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE; + } + + if (count) + return ((CamelObjectClass *) parent_class)->getv (object, ex, args); + + return 0; +} + +static int +imap4_setv (CamelObject *object, CamelException *ex, CamelArgV *args) +{ + CamelIMAP4Folder *folder = (CamelIMAP4Folder *) object; + gboolean save = FALSE; + guint32 tag; + int i; + + for (i = 0; i < args->argc; i++) { + CamelArg *arg = &args->argv[i]; + + tag = arg->tag; + + switch (tag & CAMEL_ARG_TAG) { + case CAMEL_IMAP4_FOLDER_ARG_SYNC_OFFLINE: + if (folder->sync_offline != arg->ca_int) { + folder->sync_offline = arg->ca_int; + save = TRUE; + } + break; + default: + continue; + } + + arg->tag = (tag & CAMEL_ARG_TYPE) | CAMEL_ARG_IGNORE; + } + + if (save) + camel_object_state_write (object); + + return ((CamelObjectClass *) parent_class)->setv (object, ex, args); +} + + static char * imap_get_summary_filename (const char *path) { diff --git a/camel/providers/imap4/camel-imap4-folder.h b/camel/providers/imap4/camel-imap4-folder.h index c4936dfabe..ae0263f31d 100644 --- a/camel/providers/imap4/camel-imap4-folder.h +++ b/camel/providers/imap4/camel-imap4-folder.h @@ -40,9 +40,21 @@ extern "C" { typedef struct _CamelIMAP4Folder CamelIMAP4Folder; typedef struct _CamelIMAP4FolderClass CamelIMAP4FolderClass; +enum { + CAMEL_IMAP4_FOLDER_ARG_SYNC_OFFLINE = CAMEL_FOLDER_ARG_LAST, + CAMEL_IMAP4_FOLDER_ARG_LAST = CAMEL_FOLDER_ARG_LAST + 0x100 +}; + + +enum { + CAMEL_IMAP4_FOLDER_SYNC_OFFLINE = CAMEL_IMAP4_FOLDER_ARG_SYNC_OFFLINE | CAMEL_ARG_BOO, +}; + struct _CamelIMAP4Folder { CamelFolder parent_object; + unsigned int sync_offline:1; + CamelFolderSearch *search; CamelDataCache *cache; diff --git a/camel/providers/imap4/camel-imap4-provider.c b/camel/providers/imap4/camel-imap4-provider.c index a1b5c7fd39..fa529e0c2a 100644 --- a/camel/providers/imap4/camel-imap4-provider.c +++ b/camel/providers/imap4/camel-imap4-provider.c @@ -46,6 +46,16 @@ CamelProviderConfEntry imap4_conf_entries[] = { { CAMEL_PROVIDER_CONF_ENTRY, "namespace", "override_namespace", N_("Namespace") }, { CAMEL_PROVIDER_CONF_SECTION_END }, + { CAMEL_PROVIDER_CONF_SECTION_START, "general", NULL, N_("Options") }, + { CAMEL_PROVIDER_CONF_CHECKBOX, "filter", NULL, + N_("Apply filters to new messages in INBOX on this server"), "0" }, + { CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk", NULL, + N_("Check new messages for Junk contents"), "0" }, + { CAMEL_PROVIDER_CONF_CHECKBOX, "filter_junk_inbox", "filter_junk", + N_("Only check for Junk messages in the INBOX folder"), "0" }, + { CAMEL_PROVIDER_CONF_CHECKBOX, "sync_offline", NULL, + N_("Automatically synchronize remote mail locally"), "0" }, + { CAMEL_PROVIDER_CONF_SECTION_END }, { CAMEL_PROVIDER_CONF_END } }; |