aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-09-12 04:56:47 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-09-12 04:56:47 +0800
commite98f2565b3933b735c82753cd6d579d74de639df (patch)
tree5c63c945cf788d1bc2ba28a736c0111eb6e46b65
parent8959d0d50a5c8441d74e61b62dda2cccfd13aa98 (diff)
downloadgsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar.gz
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar.bz2
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar.lz
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar.xz
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.tar.zst
gsoc2013-evolution-e98f2565b3933b735c82753cd6d579d74de639df.zip
Don't freeze/thaw the default inbox here, let the caller freeze/thaw it.
2000-09-11 Jeffrey Stedfast <fejj@helixcode.com> * filter-driver.c (filter_driver_run): Don't freeze/thaw the default inbox here, let the caller freeze/thaw it. Don't destroy the folders hash table here, it's faster if we wait till the filter-driver is destroyed. (filter_driver_finalise): Destroy the folders hash table here (filter_driver_init): Initialize the folders hash table here svn path=/trunk/; revision=5346
-rw-r--r--filter/ChangeLog9
-rw-r--r--filter/filter-driver.c33
2 files changed, 20 insertions, 22 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 37d6e02140..084b7833d4 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,5 +1,14 @@
2000-09-11 Jeffrey Stedfast <fejj@helixcode.com>
+ * filter-driver.c (filter_driver_run): Don't freeze/thaw the
+ default inbox here, let the caller freeze/thaw it. Don't destroy
+ the folders hash table here, it's faster if we wait till the
+ filter-driver is destroyed.
+ (filter_driver_finalise): Destroy the folders hash table here
+ (filter_driver_init): Initialize the folders hash table here
+
+2000-09-11 Jeffrey Stedfast <fejj@helixcode.com>
+
* filtertypes.xml: Changed "Header" to be "Message header" so it's
not quite as confusing (??)
diff --git a/filter/filter-driver.c b/filter/filter-driver.c
index e82c884f6e..257869081d 100644
--- a/filter/filter-driver.c
+++ b/filter/filter-driver.c
@@ -158,6 +158,8 @@ filter_driver_init (FilterDriver *obj)
p->globals = g_hash_table_new (g_str_hash, g_str_equal);
+ p->folders = g_hash_table_new (g_str_hash, g_str_equal);
+
/* Will get set in filter_driver_run */
p->ex = NULL;
}
@@ -172,10 +174,14 @@ free_hash_strings (void *key, void *value, void *data)
static void
filter_driver_finalise (GtkObject *obj)
{
- FilterDriver *d = (FilterDriver *) obj;
- struct _FilterDriverPrivate *p = _PRIVATE (d);
+ FilterDriver *driver = (FilterDriver *) obj;
+ struct _FilterDriverPrivate *p = _PRIVATE (driver);
+
+ /* close all folders that were opened for appending */
+ close_folders (driver);
+ g_hash_table_destroy (p->folders);
- g_hash_table_foreach (p->globals, free_hash_strings, d);
+ g_hash_table_foreach (p->globals, free_hash_strings, driver);
g_hash_table_destroy (p->globals);
gtk_object_unref (GTK_OBJECT (p->eval));
@@ -358,8 +364,7 @@ open_folder (FilterDriver *driver, const char *folder_url)
static void
close_folder (void *key, void *value, void *data)
-{
-
+{
CamelFolder *folder = value;
FilterDriver *driver = data;
struct _FilterDriverPrivate *p = _PRIVATE (driver);
@@ -368,8 +373,8 @@ close_folder (void *key, void *value, void *data)
mail_tool_camel_lock_up ();
camel_folder_sync (folder, FALSE, p->ex);
camel_folder_thaw (folder);
- mail_tool_camel_lock_down ();
camel_object_unref (CAMEL_OBJECT (folder));
+ mail_tool_camel_lock_down ();
}
/* flush/close all folders */
@@ -416,13 +421,6 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message, CamelMessage
p->message = message;
p->info = info;
- /* setup runtime data */
- p->folders = g_hash_table_new (g_str_hash, g_str_equal);
-
- mail_tool_camel_lock_up ();
- camel_folder_freeze (inbox);
- mail_tool_camel_lock_down ();
-
fsearch = g_string_new ("");
faction = g_string_new ("");
@@ -477,15 +475,6 @@ filter_driver_run (FilterDriver *driver, CamelMimeMessage *message, CamelMessage
filtered = TRUE;
}
- /* close all folders that were opened for appending */
- close_folders (driver);
- g_hash_table_destroy (p->folders);
-
- /* thaw the inbox folder */
- mail_tool_camel_lock_up ();
- camel_folder_thaw (inbox);
- mail_tool_camel_lock_down ();
-
/* transfer the exception over to the parents exception */
if (camel_exception_is_set (p->ex))
camel_exception_xfer (ex, p->ex);