aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-local.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-10-18 14:13:12 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-10-18 14:13:12 +0800
commitee5eeb1dd21eee94538ffafe27cb58bc80d0d306 (patch)
tree795fa1429fd972b8439d6d5877f00952888655f7 /mail/mail-local.c
parent229f78b929e0a9553b543f596a7643129d80b494 (diff)
downloadgsoc2013-evolution-ee5eeb1dd21eee94538ffafe27cb58bc80d0d306.tar.gz
gsoc2013-evolution-ee5eeb1dd21eee94538ffafe27cb58bc80d0d306.tar.zst
gsoc2013-evolution-ee5eeb1dd21eee94538ffafe27cb58bc80d0d306.zip
No, we REALLY dont want to perform an immediate search as the keys are
2000-10-18 Not Zed <NotZed@HelixCode.com> * folder-browser.c (folder_browser_gui_init): No, we REALLY dont want to perform an immediate search as the keys are pressed. * mail-display.c (on_object_requested): Kill a minor warning with a cast. * mail-config.c: Include mising ctype.h to kill a warning. * message-thread.c (main): Fixed the test case for api changes. * message-list.c (message_list_drag_data_get): Set some flags to get_folder(). I dont even think this will work because mail_tool_get_folder doesn't handle file url's. * mail-vfolder.c (vfolder_uri_to_folder): Pass appropriate flags. * mail-ops.c (do_setup_folder): Pass appropriate flags. Hmm, whats the difference between setup and create. *shrug* (do_create_folder): Pass appropriate flags to get_folder. Needs a way to specify the index flag. * mail-tools.c (mail_tool_get_folder_from_urlname): Changed create to flags argument. (mail_tool_get_local_inbox_url): Add an index argument. (mail_tool_get_local_inbox): honour index flag. (mail_tool_get_inbox): Changed for api change. (mail_tool_uri_to_folder): Fixed calls to store_get_folder(); * mail-local.c (load_metainfo): Added an indexed field to the metainfo. (save_metainfo): And save it too. (do_reconfigure_folder): Honour index flag when creating the new folder. Do not open the old folder with an index at all. (mail_local_map_uri): Add an index argument - tells if the mbox is indexed. (mail_tool_local_uri_to_folder): Create & pass flags properly. (#include gnome.h): Dont include all of gnome, just what we use, and explicity include xml-memory, so we get xmlFree(). svn path=/trunk/; revision=5979
Diffstat (limited to 'mail/mail-local.c')
-rw-r--r--mail/mail-local.c41
1 files changed, 34 insertions, 7 deletions
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 04ca6fe0d1..a852b7c183 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -33,8 +33,9 @@
#include <config.h>
#endif
#include <bonobo.h>
-#include <gnome.h>
+#include <libgnomeui/gnome-dialog.h>
#include <glade/glade.h>
+#include <gnome-xml/xmlmemory.h>
#include "Evolution.h"
#include "evolution-storage.h"
@@ -60,6 +61,7 @@ struct _local_meta {
char *format; /* format of mailbox */
char *name; /* name of mbox itself */
+ int indexed; /* do we index the body? */
};
static struct _local_meta *
@@ -85,8 +87,16 @@ load_metainfo(const char *path)
node = node->childs;
while (node) {
if (!strcmp(node->name, "folder")) {
+ char *index;
meta->format = xmlGetProp(node, "type");
meta->name = xmlGetProp(node, "name");
+ index = xmlGetProp(node, "index");
+ if (index) {
+ meta->indexed = atoi(index);
+ xmlFree(index);
+ } else
+ meta->indexed = TRUE;
+
}
node = node->next;
}
@@ -96,6 +106,7 @@ load_metainfo(const char *path)
dodefault:
meta->format = g_strdup("mbox"); /* defaults */
meta->name = g_strdup("mbox");
+ meta->indexed = TRUE;
if (doc)
xmlFreeDoc(doc);
return meta;
@@ -126,6 +137,7 @@ save_metainfo(struct _local_meta *meta)
node = xmlNewChild(root, NULL, "folder", NULL);
xmlSetProp(node, "type", meta->format);
xmlSetProp(node, "name", meta->name);
+ xmlSetProp(node, "index", meta->indexed?"1":"0");
ret = xmlSaveFile(meta->path, doc);
xmlFreeDoc(doc);
@@ -134,7 +146,7 @@ save_metainfo(struct _local_meta *meta)
/* maps a local uri to the real type */
char *
-mail_local_map_uri(const char *uri)
+mail_local_map_uri(const char *uri, int *index)
{
CamelURL *url;
char *metapath;
@@ -142,6 +154,9 @@ mail_local_map_uri(const char *uri)
struct _local_meta *meta;
CamelException *ex;
+ if (index)
+ *index = TRUE;
+
if (strncmp(uri, "file:", 5)) {
g_warning("Trying to map non-local uri: %s", uri);
return g_strdup(uri);
@@ -159,6 +174,9 @@ mail_local_map_uri(const char *uri)
meta = load_metainfo(metapath);
g_free(metapath);
+ if (index)
+ *index = meta->indexed;
+
/* change file: to format: */
camel_url_set_protocol(url, meta->format);
storename = camel_url_to_string(url, TRUE);
@@ -175,6 +193,7 @@ mail_tool_local_uri_to_folder(const char *uri, CamelException *ex)
char *storename;
CamelFolder *folder = NULL;
struct _local_meta *meta;
+ int flags;
if (strncmp(uri, "file:", 5)) {
return NULL;
@@ -197,8 +216,11 @@ mail_tool_local_uri_to_folder(const char *uri, CamelException *ex)
storename = camel_url_to_string(url, TRUE);
printf("store name is %s\n", storename);
+ flags = 0;
+ if (meta->indexed)
+ flags |= CAMEL_STORE_FOLDER_BODY_INDEX;
- folder = mail_tool_get_folder_from_urlname (storename, meta->name, FALSE, ex);
+ folder = mail_tool_get_folder_from_urlname (storename, meta->name, flags, ex);
camel_url_free(url);
g_free (storename);
free_metainfo(meta);
@@ -297,6 +319,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex)
char *uri;
CamelURL *url = NULL;
struct _local_meta *meta;
+ guint32 flags;
printf("reconfiguring folder: %s to type %s\n", input->fb->uri, input->newtype);
@@ -342,7 +365,7 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex)
if (camel_exception_is_set(ex))
goto cleanup;
- /* rename the old mbox and open it again */
+ /* rename the old mbox and open it again, without indexing */
tmpname = g_strdup_printf("%s_reconfig", meta->name);
printf("renaming %s to %s, and opening it\n", meta->name, tmpname);
update_progress("Renaming old folder and opening", 0.0);
@@ -353,8 +376,9 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex)
mail_tool_camel_lock_down ();
goto cleanup;
}
-
- fromfolder = camel_store_get_folder(fromstore, tmpname, TRUE, ex);
+
+ /* we dont need to set the create flag ... or need an index if it has one */
+ fromfolder = camel_store_get_folder(fromstore, tmpname, 0, ex);
if (fromfolder == NULL || camel_exception_is_set(ex)) {
/* try and recover ... */
camel_exception_clear (ex);
@@ -367,7 +391,10 @@ do_reconfigure_folder(gpointer in_data, gpointer op_data, CamelException *ex)
printf("Creating the destination mbox\n");
update_progress("Creating new folder", 0.0);
- tofolder = camel_store_get_folder(tostore, meta->name, TRUE, ex);
+ flags = CAMEL_STORE_FOLDER_CREATE;
+ if (meta->indexed)
+ flags |= CAMEL_STORE_FOLDER_BODY_INDEX;
+ tofolder = camel_store_get_folder(tostore, meta->name, flags, ex);
if (tofolder == NULL || camel_exception_is_set(ex)) {
printf("cannot open destination folder\n");
/* try and recover ... */
> * - Tweaked source to allow use under Perl 5.6aaron2006-05-263-3/+19 * Adding port converters/p5-XML-WBXML, Convert between XML and WBXML using libw...aaron2006-05-266-0/+65 * - Update to 1.4.1mnag2006-05-242-4/+4 * portlint:mezz2006-05-161-34/+2 * - Update to 2.17clsung2006-05-112-4/+4 * Update my e-mail addresssat2006-05-091-1/+1 * - Upgrade to 1.05.kuriyama2006-05-064-8/+8 * - Update to 2.16clsung2006-05-042-4/+4 * remove USE_REINPLACE for all ports with categories starting with Cedwin2006-05-049-9/+0 * Update to 1.4krion2006-05-022-4/+4 * Respect ${CC}erwin2006-04-241-0/+4 * Add 3 (!) more master sites.ehaupt2006-04-221-2/+5 * Fix build with new fribidi library.ale2006-04-211-0/+20 * Tarball has been re-rolled, with only minor changes in man pages.thierry2006-04-201-3/+3 * Upgrade to 2.11.thierry2006-04-202-4/+4 * Update to 2.15.novel2006-04-182-4/+4 * Update to 0.10.7bland2006-04-183-8/+7 * - Update to 0.7.7aehaupt2006-04-163-6/+6 * Reset okazaki due to long period of inactivity and maintainer-timeout.linimon2006-04-152-2/+2 * Reset pat due to no response to email about his status.linimon2006-04-151-1/+1 * Reset vsevolod as maintainer due to unreponsiveness. We hope to see himlinimon2006-04-151-1/+1 * Add patch-ad to patch-uudecode.c - it's patched one file.anray2006-03-282-16/+14 * Update port to 0.20scrappy2006-03-272-4/+4 * - Change TMPDIR to /tmp. [1]anray2006-03-2718-62/+505 * Drop maintainershipmarkus2006-03-251-1/+1 * Switch to a versionned tarball. No diff after extraction.thierry2006-03-162-5/+4 * Upgrade to 2.10 and make fetchable again.thierry2006-03-133-5/+18 * Bump PORTREVISION on glib12/gtk12 consumer ports to ease the upgrade path.ade2006-03-071-1/+1 * Bump PORTREVISION dur to last commitgarga2006-03-061-0/+1 * Add missing RUN_DEPENDSgarga2006-03-061-0/+1 * Upgrade to 2.9 to make fetchable again.thierry2006-03-053-76/+9 * Conversion to a single libtool environment.ade2006-02-2314-12/+55 * Add ytnef 2.6, unpack data in MS Outlook TNEF formatgarga2006-02-224-0/+61 * Move recently added converters/libytnef to an accuratte category "devel"garga2006-02-225-62/+0 * Add libytnef 1.5, unpack data in MS Outlook TNEF format.garga2006-02-225-0/+62 * Update search.cpan.org WWW: entries to have a trailing slash.fenner2006-02-213-3/+3 * - unbreak on old perlleeym2006-02-203-2/+42 * - Update to 1.09clsung2006-02-102-4/+4 * - Fix pkg-plistaz2006-02-081-1/+4 * This module provides two functions, bencode and bdecode,az2006-02-065-0/+33 * ascii2binary and binary2ascii convert between textual and binarythierry2006-01-315-0/+121 * Chase shlib bump of libexpat.kuriyama2006-01-311-2/+2 * - Upgrade to 1.03.kuriyama2006-01-304-8/+8 * Fix another PHP bug and unbreak build on amd64.ale2006-01-281-0/+10 * Add backup sites for WITH_EXTRA_PATCHES.nork2006-01-281-0/+2 * - Fix possibility of "infinite make fork" when "Registering install for ..."linimon2006-01-282-0/+2 * SHA256ify (manually done and checked)edwin2006-01-221-1/+3 * mark as broken when RUBY < 1.7edwin2006-01-221-0/+2 * SHA256ifyedwin2006-01-2240-0/+40 * - update to 2.14leeym2006-01-223-12/+11 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-222-18/+18 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-2219-44/+44 * Replace ugly "@unexec rmdir %D... 2>/dev/null || true" with @dirrmtryedwin2006-01-226-18/+18 * - Update to 1.6sem2006-01-228-161/+16 * Remove myself from MAINTAINERache2006-01-211-1/+1 * BROKEN: Incorrect pkg-plistkris2006-01-201-0/+2 * Update to 0.64skv2006-01-182-4/+4 * - ruby-iconv is no longer considered experimentalpav2006-01-141-3/+0 * Update to 1.4edwin2006-01-052-4/+4 * [patch] bug in the uulib-0.5.20edwin2006-01-041-0/+22 * [patch] bug in the uulib-0.5.20edwin2006-01-042-0/+2 * Update to 2.12, remove IGNORE for newer perl.tobez2005-12-273-5/+6 * New port nomyso version 3.0: Convert MASM/TASM files to NASMlioux2005-12-234-0/+48 * Remove duplicate port entry converters/intel2gas since it alreadylioux2005-12-236-170/+0 * New port intel2gas version 1.3.3: MASM/NASM/TASM to GNU asm syntaxlioux2005-12-236-0/+170 * New port ta2as version 0.8: TASM to AT&T asm syntax converterlioux2005-12-236-0/+97 * - require devel/p5-XSLoader and unbreak it on perl 5.005leeym2005-12-211-1/+5 * New port p5-Unicode-UTF8simple version 1.06: Conversions to/fromlioux2005-12-205-0/+43 * -Update to 0.9.8.mezz2005-12-134-147/+107 * - update to 1.06leeym2005-12-112-4/+4 * Plug memory leak in librecode.demon2005-12-083-1/+52 * - Update MASTER_SITES to fix fetch [1]ahze2005-12-082-2/+2 * Update to 0.62skv2005-12-032-3/+4 * - update port from v0.20 to v0.21aaron2005-12-033-4/+6 * - Update to 3.07erwin2005-12-024-19/+12 * - Fix latest commit adding a missing dependency (devel/p5-Class-ErrorHandler).flz2005-12-011-1/+3 * - Update to 2.1pav2005-12-012-3/+4 * - Update to 0.07.flz2005-11-303-5/+4 * - Update to 0.19.flz2005-11-292-3/+4 * The Ruby contrib directory hasn't existed for some time; mirror thefenner2005-11-281-2/+2 * - Add SHA256pav2005-11-271-0/+1 * big whitespace cleanup (see ports/65409)edwin2005-11-251-1/+1 * - Upgrade to 1.02.kuriyama2005-11-244-6/+8 * - Remove checksum for nonexistant filepav2005-11-241-1/+2