aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-26 13:23:46 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-26 13:23:46 +0800
commitfc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f (patch)
treedc8cc5c1392b8a88156a98a229657b8e9f15718a /camel/providers
parent28e3d6dc45dd4ab5e0d34078fdf86f1923d0e177 (diff)
downloadgsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar.gz
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar.bz2
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar.lz
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar.xz
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.tar.zst
gsoc2013-evolution-fc13ab0c7ca5ff6d5735e8900f0fbf1dc9d3934f.zip
Added new maildir flags D for draft and commented P for forwarded.
2004-03-26 Not Zed <NotZed@Ximian.com> * providers/local/camel-maildir-summary.c (flagbits[]): Added new maildir flags D for draft and commented P for forwarded. * providers/imap/camel-imap-store.c (get_folder_counts): Instead of looking up the folder in the object bag which will handle reservations and perhaps deadlock, just get the list of opened folders and use them if they're available. Should fix #56045. svn path=/trunk/; revision=25195
Diffstat (limited to 'camel/providers')
-rw-r--r--camel/providers/imap/camel-imap-store.c22
-rw-r--r--camel/providers/local/camel-maildir-summary.c2
2 files changed, 20 insertions, 4 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index 32bb41179b..2d8206b79d 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -2392,7 +2392,19 @@ static void
get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelException *ex)
{
GSList *q;
+ GPtrArray *folders;
+ GHashTable *folders_table;
CamelFolder *folder;
+ int i;
+
+ /* We list rather than use get here, and manage our own lookups outside of the bag,
+ since get will wait if someone has reserved the name - can cause deadlock */
+ folders = camel_object_bag_list(CAMEL_STORE(imap_store)->folders);
+ folders_table = g_hash_table_new(g_str_hash, g_str_equal);
+ for (i=0; i<folders->len;i++) {
+ folder = folders->pdata[i];
+ g_hash_table_insert(folders_table, folder->full_name, folder);
+ }
/* non-recursive breath first search */
@@ -2424,15 +2436,12 @@ get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelExceptio
fi->unread = get_folder_status (imap_store, fi->full_name, "UNSEEN");
fi->total = get_folder_status(imap_store, fi->full_name, "MESSAGES");
/* if we have this folder open, and the unread count has changed, update */
- folder = camel_object_bag_get(CAMEL_STORE(imap_store)->folders, fi->full_name);
+ folder = g_hash_table_lookup(folders_table, fi->full_name);
if (folder && fi->unread != camel_folder_get_unread_message_count(folder)) {
CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, ex);
fi->unread = camel_folder_get_unread_message_count(folder);
fi->total = camel_folder_get_message_count(folder);
}
- if (folder)
- camel_object_unref(folder);
-
}
CAMEL_SERVICE_UNLOCK (imap_store, connect_lock);
@@ -2446,6 +2455,11 @@ get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelExceptio
fi = fi->next;
}
}
+
+ g_hash_table_destroy(folders_table);
+ for (i=0; i<folders->len;i++)
+ camel_object_unref(folders->pdata[i]);
+ g_ptr_array_free(folders, TRUE);
}
/* imap needs to treat inbox case insensitive */
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 37e1ac2ce7..edc81a5230 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -168,7 +168,9 @@ static struct {
char flag;
guint32 flagbit;
} flagbits[] = {
+ { 'D', CAMEL_MESSAGE_DRAFT },
{ 'F', CAMEL_MESSAGE_FLAGGED },
+ /*{ 'P', CAMEL_MESSAGE_FORWARDED },*/
{ 'R', CAMEL_MESSAGE_ANSWERED },
{ 'S', CAMEL_MESSAGE_SEEN },
{ 'T', CAMEL_MESSAGE_DELETED },