aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-local.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-local.c')
-rw-r--r--mail/mail-local.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/mail/mail-local.c b/mail/mail-local.c
index 6b1359e73c..666cfefbbd 100644
--- a/mail/mail-local.c
+++ b/mail/mail-local.c
@@ -623,12 +623,10 @@ static void
local_folder_changed (CamelObject *object, gpointer event_data,
gpointer user_data)
{
- CamelFolder *folder = CAMEL_FOLDER (object);
MailLocalFolder *local_folder = user_data;
- int unread;
+ int unread = GPOINTER_TO_INT (event_data);
char *display;
- unread = camel_folder_get_unread_message_count (folder);
if (unread != local_folder->last_unread) {
CORBA_Environment ev;
@@ -652,6 +650,18 @@ local_folder_changed (CamelObject *object, gpointer event_data,
}
}
+static void
+local_folder_changed_proxy (CamelObject *object, gpointer event_data,
+ gpointer user_data)
+{
+ CamelFolder *folder = CAMEL_FOLDER (object);
+ int unread;
+
+ unread = camel_folder_get_unread_message_count (folder);
+ mail_op_forward_event (local_folder_changed, object,
+ GINT_TO_POINTER (unread), user_data);
+}
+
static char *
describe_register_folder (gpointer in_data, gboolean gerund)
{
@@ -686,6 +696,8 @@ do_register_folder (gpointer in_data, gpointer op_data, CamelException *ex)
if (meta->indexed)
flags |= CAMEL_STORE_FOLDER_BODY_INDEX;
local_folder->folder = camel_store_get_folder (store, meta->name, flags, ex);
+ local_folder->last_unread = camel_folder_get_unread_message_count (
+ local_folder->folder);
camel_object_unref (CAMEL_OBJECT (store));
free_metainfo (meta);
}
@@ -704,10 +716,9 @@ cleanup_register_folder (gpointer in_data, gpointer op_data,
g_hash_table_insert (local_folder->local_store->folders,
local_folder->name, local_folder->folder);
local_folder->name = strrchr (local_folder->path, '/') + 1;
- local_folder->last_unread = 0;
camel_object_hook_event (CAMEL_OBJECT (local_folder->folder),
- "folder_changed", local_folder_changed,
+ "folder_changed", local_folder_changed_proxy,
local_folder);
local_folder_changed (CAMEL_OBJECT (local_folder->folder),
NULL, local_folder);