aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-folder.c
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2001-06-29 00:50:09 +0800
committerDan Winship <danw@src.gnome.org>2001-06-29 00:50:09 +0800
commita357fc5b44d807a81b066960e584787e263cd7d1 (patch)
tree6d4c95c0dbe5cf63d37a3ae11c0c99a69a228703 /camel/camel-folder.c
parent311491b26baf67164d5486b13cf794c29d6000cf (diff)
downloadgsoc2013-evolution-a357fc5b44d807a81b066960e584787e263cd7d1.tar.gz
gsoc2013-evolution-a357fc5b44d807a81b066960e584787e263cd7d1.tar.zst
gsoc2013-evolution-a357fc5b44d807a81b066960e584787e263cd7d1.zip
If the folder is frozen, don't refresh, just record that we need to do it
* providers/imap/camel-imap-folder.c (imap_refresh_info): If the folder is frozen, don't refresh, just record that we need to do it later. (imap_append_online): If the APPEND doesn't trigger an immediate EXISTS response (because the folder isn't the selected folder, or because the server doesn't do that until the next command), call imap_refresh_info on the folder. (imap_copy_online): Likewise. (Replacing the unconditional NOOP that was there before, which absolutely killed filter performance by forcing the IMAP provider to switch back and forth between folders after every copy or move.) (imap_thaw): If the folder needs a refresh, do it. * camel-folder.c (camel_folder_is_frozen): New method svn path=/trunk/; revision=10565
Diffstat (limited to 'camel/camel-folder.c')
-rw-r--r--camel/camel-folder.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index ecf9190a36..4e679f36ae 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -109,6 +109,7 @@ static void move_messages_to (CamelFolder *source,
static void freeze (CamelFolder *folder);
static void thaw (CamelFolder *folder);
+static gboolean is_frozen (CamelFolder *folder);
static gboolean folder_changed (CamelObject *object,
gpointer event_data);
@@ -154,6 +155,7 @@ camel_folder_class_init (CamelFolderClass *camel_folder_class)
camel_folder_class->move_messages_to = move_messages_to;
camel_folder_class->freeze = freeze;
camel_folder_class->thaw = thaw;
+ camel_folder_class->is_frozen = is_frozen;
/* virtual method overload */
camel_object_class_declare_event (camel_object_class,
@@ -1310,6 +1312,26 @@ camel_folder_thaw (CamelFolder *folder)
CF_CLASS (folder)->thaw (folder);
}
+static gboolean
+is_frozen (CamelFolder *folder)
+{
+ return folder->priv->frozen != 0;
+}
+
+/**
+ * camel_folder_is_frozen:
+ * @folder: a folder
+ *
+ * Return value: whether or not the folder is frozen.
+ **/
+gboolean
+camel_folder_is_frozen (CamelFolder *folder)
+{
+ g_return_val_if_fail (CAMEL_IS_FOLDER (folder), FALSE);
+
+ return CF_CLASS (folder)->is_frozen (folder);
+}
+
/* Event hooks that block emission when frozen */
static gboolean