From 21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 21 Oct 2003 18:51:30 +0000 Subject: Merge new-ui-branch into the trunk. svn path=/trunk/; revision=22966 --- camel/ChangeLog | 47 ++++++++++++++++++++++++++++ camel/camel-arg.c | 4 +++ camel/camel-arg.h | 1 + camel/camel-object.c | 9 ++++++ camel/camel-provider.c | 4 +-- camel/camel-provider.h | 5 +-- camel/camel-store.c | 23 ++++++++++---- camel/providers/local/camel-local-folder.c | 24 +++++++++++--- camel/providers/local/camel-local-folder.h | 2 +- camel/providers/local/camel-local-provider.c | 10 +++--- 10 files changed, 108 insertions(+), 21 deletions(-) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 286058dc8e..343bbf3afb 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,7 +1,43 @@ +2003-10-21 Not Zed + + * providers/local/camel-local-folder.c (local_getv, local_setv): + use the right tag name for the index_body arg. + (local_sync): write any persistent metadata - to make it + persistent. + (camel_local_folder_construct): turn off indexing, for now, it + should be done in local_setv. + + * providers/local/camel-local-folder.h: change body_index to a bool + type. + + * camel-object.c (cobject_state_read, cobject_state_write): handle + bool types + (cobject_state_write): make sure we free all arg types. + + * camel-arg.c (camel_argv_build): + (camel_arggetv_build): handle bool type. + + * camel-arg.h: Added BOO (bool) type. + +2003-10-15 Not Zed + + * camel-store.c (camel_folder_info_build): Fix so we output the + tree in sorted depth-first order, rather in reverse. + 2003-10-16 Jeffrey Stedfast * camel-sasl-kerberos4.c: Fixed a #include. +2003-10-10 Not Zed + + * providers/local/camel-local-provider.c: set the url fragment + flag for local providers. + + * camel-provider.h: Move the URL_PART_NEED bits to the high 16 + bits, to allow for easier changes in the future. Added a + URL_PART_FRAGMENT flag for providers that use fragment = folder + path. + 2003-10-09 Jeffrey Stedfast * camel-mime-utils.c (header_decode_date): Allow timezone offsets @@ -20,6 +56,12 @@ localhost lookup results in a numeric IPv6 host, use the form "[IPv6:]" as specified in rfc2821. Fixes bug #46006. +2003-09-23 Ettore Perazzoli + + * providers/local/camel-local-provider.c: Set the IS_STORAGE bit + in the mbox provider, since it can now contain a hierarchy of + folders. + 2003-09-23 Jeffrey Stedfast * providers/local/camel-mbox-store.c (get_folder): If the CREATE @@ -687,6 +729,11 @@ addr->str to make sure that it is valid UTF-8, if not convert it to UTF-8. Fixes bug #42170. +2003-07-23 Ettore Perazzoli + + * camel-provider.c (camel_provider_init): Print the provider + directory as well, for debugging. + 2003-07-23 Jeffrey Stedfast * camel-mime-message.c (find_best_encoding): Revert my previous diff --git a/camel/camel-arg.c b/camel/camel-arg.c index f8cd048f0a..bcd79bab59 100644 --- a/camel/camel-arg.c +++ b/camel/camel-arg.c @@ -60,6 +60,9 @@ int camel_argv_build(CamelArgV *tv) case CAMEL_ARG_PTR: a->ca_ptr = va_arg(tv->ap, void *); break; + case CAMEL_ARG_BOO: + a->ca_int = va_arg(tv->ap, int) != 0; + break; default: printf("Error, unknown type, truncating result\n"); more = FALSE; @@ -96,6 +99,7 @@ int camel_arggetv_build(CamelArgGetV *tv) *a->ca_object = NULL; break; case CAMEL_ARG_INT: + case CAMEL_ARG_BOO: a->ca_int = va_arg(tv->ap, int *); *a->ca_int = 0; break; diff --git a/camel/camel-arg.h b/camel/camel-arg.h index 1213596457..ebecc0f217 100644 --- a/camel/camel-arg.h +++ b/camel/camel-arg.h @@ -45,6 +45,7 @@ enum camel_arg_t { CAMEL_ARG_DBL = 0x20000000, /* double */ CAMEL_ARG_STR = 0x30000000, /* c string */ CAMEL_ARG_PTR = 0x40000000, /* ptr */ + CAMEL_ARG_BOO = 0x50000000, /* bool */ }; typedef struct _CamelArg CamelArg; diff --git a/camel/camel-object.c b/camel/camel-object.c index 31d458a59d..744e9f7566 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -439,6 +439,7 @@ cobject_state_read(CamelObject *obj, FILE *fp) switch(argv->argv[argv->argc].tag & CAMEL_ARG_TYPE) { case CAMEL_ARG_INT: + case CAMEL_ARG_BOO: if (camel_file_util_decode_uint32(fp, &argv->argv[argv->argc].ca_int) == -1) goto cleanup; break; @@ -535,6 +536,7 @@ cobject_state_write(CamelObject *obj, FILE *fp) switch (arg->tag & CAMEL_ARG_TYPE) { case CAMEL_ARG_INT: + case CAMEL_ARG_BOO: if (camel_file_util_encode_uint32(fp, arg->ca_int) == -1) goto abort; break; @@ -547,6 +549,13 @@ cobject_state_write(CamelObject *obj, FILE *fp) res = 0; abort: + for (i=0;iargc;i++) { + CamelArg *arg = &argv->argv[i]; + + if ((argv->argv[i].tag & CAMEL_ARG_TYPE) == CAMEL_ARG_STR) + camel_object_free(obj, arg->tag, arg->ca_str); + } + g_free(argv); g_free(arggetv); diff --git a/camel/camel-provider.c b/camel/camel-provider.c index 9beacc02f0..321b3077cd 100644 --- a/camel/camel-provider.c +++ b/camel/camel-provider.c @@ -70,8 +70,8 @@ camel_provider_init (void) dir = opendir (CAMEL_PROVIDERDIR); if (!dir) { - g_error ("Could not open camel provider directory: %s", - g_strerror (errno)); + g_error ("Could not open camel provider directory (%s): %s", + CAMEL_PROVIDERDIR, g_strerror (errno)); return NULL; } diff --git a/camel/camel-provider.h b/camel/camel-provider.h index edfb424181..98c5a3ed6a 100644 --- a/camel/camel-provider.h +++ b/camel/camel-provider.h @@ -81,7 +81,7 @@ extern char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES]; #define CAMEL_URL_PART_PORT (1 << 4) #define CAMEL_URL_PART_PATH (1 << 5) -#define CAMEL_URL_PART_NEED 6 +#define CAMEL_URL_PART_NEED 8 /* Use these macros to test a provider's url_flags */ #define CAMEL_PROVIDER_ALLOWS(prov, flags) (prov->url_flags & (flags | (flags << CAMEL_URL_PART_NEED))) @@ -102,7 +102,8 @@ extern char *camel_provider_type_name[CAMEL_NUM_PROVIDER_TYPES]; #define CAMEL_URL_NEED_PORT (CAMEL_URL_PART_PORT << CAMEL_URL_PART_NEED) #define CAMEL_URL_NEED_PATH (CAMEL_URL_PART_PATH << CAMEL_URL_PART_NEED) -#define CAMEL_URL_PATH_IS_ABSOLUTE (1 << 12) +#define CAMEL_URL_FRAGMENT_IS_PATH (1 << 30) /* url uses fragment for folder name path, not path */ +#define CAMEL_URL_PATH_IS_ABSOLUTE (1 << 31) #define CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT(prov) (prov->object_types[CAMEL_PROVIDER_STORE] && prov->object_types[CAMEL_PROVIDER_TRANSPORT]) diff --git a/camel/camel-store.c b/camel/camel-store.c index eedc9dfa2a..3c49f312ec 100644 --- a/camel/camel-store.c +++ b/camel/camel-store.c @@ -776,7 +776,7 @@ CamelFolderInfo * camel_folder_info_build (GPtrArray *folders, const char *namespace, char separator, gboolean short_names) { - CamelFolderInfo *fi, *pfi, *top = NULL; + CamelFolderInfo *fi, *pfi, *top = NULL, *tail = NULL; GHashTable *hash; char *name, *p, *pname; int i, nlen; @@ -854,9 +854,15 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace, g_hash_table_insert (hash, pname, pfi); g_ptr_array_add (folders, pfi); } - fi->sibling = pfi->child; + tail = pfi->child; + if (tail == NULL) { + pfi->child = fi; + } else { + while (tail->sibling) + tail = tail->sibling; + tail->sibling = fi; + } fi->parent = pfi; - pfi->child = fi; } else if (!top) top = fi; } @@ -864,13 +870,18 @@ camel_folder_info_build (GPtrArray *folders, const char *namespace, g_hash_table_destroy (hash); /* Link together the top-level folders */ + tail = top; for (i = 0; i < folders->len; i++) { fi = folders->pdata[i]; if (fi->parent || fi == top) continue; - if (top) - fi->sibling = top; - top = fi; + if (tail == NULL) { + tail = fi; + top = fi; + } else { + tail->sibling = fi; + tail = fi; + } } return top; diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c index 608954af94..b774c8b5f6 100644 --- a/camel/providers/local/camel-local-folder.c +++ b/camel/providers/local/camel-local-folder.c @@ -251,7 +251,9 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con } camel_object_set(lf, NULL, CAMEL_OBJECT_STATE_FILE, statepath, NULL); g_free (statepath); - + + lf->flags = flags; + if (camel_object_state_read(lf) == -1) { /* FIXME: load defaults? */ } @@ -269,7 +271,8 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con the old-format 'ibex' files that might be lying around */ unlink(lf->index_path); -#if 0 + /* FIXME: Need to run indexing off of the setv method */ +#if 1 forceindex = FALSE; #else /* if we have no/invalid index file, force it */ @@ -292,8 +295,8 @@ camel_local_folder_construct(CamelLocalFolder *lf, CamelStore *parent_store, con camel_text_index_remove(lf->index_path); forceindex = FALSE; } -#endif lf->flags = flags; +#endif folder->summary = (CamelFolderSummary *)CLOCALF_CLASS(lf)->create_summary(lf->summary_path, lf->folder_path, lf->index); if (camel_local_summary_load((CamelLocalSummary *)folder->summary, forceindex, ex) == -1) { @@ -404,7 +407,9 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args) break; } - case CAMEL_LOCAL_FOLDER_INDEX_BODY: + case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY: + printf("getv:'%s' flags %08x\n", ((CamelFolder *)object)->full_name, ((CamelLocalFolder *)object)->flags); + /* FIXME: remove this from sotre flags */ *arg->ca_int = (((CamelLocalFolder *)folder)->flags & CAMEL_STORE_FOLDER_BODY_INDEX) != 0; break; @@ -431,9 +436,16 @@ local_setv(CamelObject *object, CamelException *ex, CamelArgV *args) tag = arg->tag; switch (tag & CAMEL_ARG_TAG) { - case CAMEL_LOCAL_FOLDER_INDEX_BODY: + case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY: /* FIXME: implement */ + /* TODO: When turning on (off?) the index, we want to launch a task for it, + and make sure we dont have multiple tasks doing the same job */ printf("setting folder indexing %s\n", arg->ca_int?"on":"off"); + if (arg->ca_int) + ((CamelLocalFolder *)object)->flags |= CAMEL_STORE_FOLDER_BODY_INDEX; + else + ((CamelLocalFolder *)object)->flags &= ~CAMEL_STORE_FOLDER_BODY_INDEX; + printf("setv:'%s' flags %08x\n", ((CamelFolder *)object)->full_name, ((CamelLocalFolder *)object)->flags); break; default: continue; @@ -494,6 +506,8 @@ local_sync(CamelFolder *folder, gboolean expunge, CamelException *ex) if (camel_local_folder_lock(lf, CAMEL_LOCK_WRITE, ex) == -1) return; + camel_object_state_write(lf); + /* if sync fails, we'll pass it up on exit through ex */ camel_local_summary_sync((CamelLocalSummary *)folder->summary, expunge, lf->changes, ex); camel_local_folder_unlock(lf); diff --git a/camel/providers/local/camel-local-folder.h b/camel/providers/local/camel-local-folder.h index 4fb5980a07..73059f03b3 100644 --- a/camel/providers/local/camel-local-folder.h +++ b/camel/providers/local/camel-local-folder.h @@ -47,7 +47,7 @@ enum { }; enum { - CAMEL_LOCAL_FOLDER_INDEX_BODY = CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY | CAMEL_ARG_INT, + CAMEL_LOCAL_FOLDER_INDEX_BODY = CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY | CAMEL_ARG_BOO, }; typedef struct { diff --git a/camel/providers/local/camel-local-provider.c b/camel/providers/local/camel-local-provider.c index 077bc45b5f..a52dfbde5f 100644 --- a/camel/providers/local/camel-local-provider.c +++ b/camel/providers/local/camel-local-provider.c @@ -50,7 +50,7 @@ static CamelProvider mh_provider = { N_("For storing local mail in MH-like mail directories."), "mail", CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL, - CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE, + CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH, mh_conf_entries, /* ... */ }; @@ -65,8 +65,8 @@ static CamelProvider mbox_provider = { N_("Local delivery"), N_("For retrieving (moving) local mail from standard mbox formated spools into folders managed by Evolution."), "mail", - CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_LOCAL, - CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE, + CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL, + CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH, mbox_conf_entries, /* ... */ }; @@ -84,7 +84,7 @@ static CamelProvider maildir_provider = { N_("For storing local mail in maildir directories."), "mail", CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE | CAMEL_PROVIDER_IS_LOCAL, - CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE, + CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH, maildir_conf_entries, /* ... */ }; @@ -102,7 +102,7 @@ static CamelProvider spool_provider = { N_("For reading and storing local mail in external standard mbox spool files.\nMay also be used to read a tree of Elm, Pine, or Mutt style folders."), "mail", CAMEL_PROVIDER_IS_SOURCE | CAMEL_PROVIDER_IS_STORAGE, - CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE, + CAMEL_URL_NEED_PATH | CAMEL_URL_PATH_IS_ABSOLUTE | CAMEL_URL_FRAGMENT_IS_PATH, spool_conf_entries, /* ... */ }; -- cgit v1.2.3