aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-09-21 11:10:02 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-09-21 11:10:02 +0800
commit096dad5a2a78751c8938d3397102c132d7a045a6 (patch)
tree66d726e1e6deb51286ae28ca035107b7013d0c86 /mail
parent7d17dc2230c4a3b650849ad6e2dcdc5ebf6cb47e (diff)
downloadgsoc2013-evolution-096dad5a2a78751c8938d3397102c132d7a045a6.tar.gz
gsoc2013-evolution-096dad5a2a78751c8938d3397102c132d7a045a6.tar.zst
gsoc2013-evolution-096dad5a2a78751c8938d3397102c132d7a045a6.zip
trigger a folder changed event, so the folderinfocache stuff has a chance
2001-09-20 <NotZed@Ximian.com> * component-factory.c (got_folder): trigger a folder changed event, so the folderinfocache stuff has a chance to see if this is the outbox_folder or not. * mail-folder-cache.c (update_1folder): If we have -1 unread count, pass that as 0 to the shell so it doesn't go bolding. (setup_folder): Same. svn path=/trunk/; revision=13041
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/component-factory.c12
-rw-r--r--mail/mail-folder-cache.c17
3 files changed, 29 insertions, 10 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5feabe3c2a..0d02914947 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2001-09-20 <NotZed@Ximian.com>
+
+ * component-factory.c (got_folder): trigger a folder changed
+ event, so the folderinfocache stuff has a chance to see if this is
+ the outbox_folder or not.
+
+ * mail-folder-cache.c (update_1folder): If we have -1 unread
+ count, pass that as 0 to the shell so it doesn't go bolding.
+ (setup_folder): Same.
+
2001-09-20 Jeffrey Stedfast <fejj@ximian.com>
* mail-account-gui.c (mail_account_gui_save): Only add the account
diff --git a/mail/component-factory.c b/mail/component-factory.c
index bcade8d39e..dfad74626d 100644
--- a/mail/component-factory.c
+++ b/mail/component-factory.c
@@ -615,7 +615,17 @@ got_folder (char *uri, CamelFolder *folder, void *data)
if (folder) {
*fp = folder;
- camel_object_ref (CAMEL_OBJECT (folder));
+
+ camel_object_ref(CAMEL_OBJECT (folder));
+
+ /* emit a changed event, this is a little hack so that the folderinfo cache
+ will update knowing whether this is the outbox_folder or not, etc */
+ if (folder == outbox_folder) {
+ CamelFolderChangeInfo *changes = camel_folder_change_info_new();
+
+ camel_object_trigger_event((CamelObject *)folder, "folder_changed", changes);
+ camel_folder_change_info_free(changes);
+ }
}
}
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 520cdc4afb..4d9a881826 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -74,7 +74,7 @@ update_1folder(struct _folder_info *mfi, CamelFolderInfo *info)
{
struct _store_info *si;
CamelFolder *folder;
- int unread;
+ int unread = 0;
CORBA_Environment ev;
extern CamelFolder *outbox_folder;
@@ -88,18 +88,16 @@ update_1folder(struct _folder_info *mfi, CamelFolderInfo *info)
else
unread = camel_folder_get_unread_message_count(folder);
} else if (info)
- unread = info->unread_message_count;
- else
- unread = -1;
+ unread = (info->unread_message_count==-1)?0:info->unread_message_count;
UNLOCK(info_lock);
if (si->storage == NULL) {
- d(printf("Updating existing (local) folder: %s\n", mfi->path));
+ d(printf("Updating existing (local) folder: %s (%d unread) folder=%p\n", mfi->path, unread, folder));
CORBA_exception_init(&ev);
GNOME_Evolution_Storage_updateFolder(si->corba_storage, mfi->path, mfi->name, unread, &ev);
CORBA_exception_free(&ev);
} else {
- d(printf("Updating existing folder: %s\n", mfi->path));
+ d(printf("Updating existing folder: %s (%d unread)\n", mfi->path, unread));
evolution_storage_update_folder(si->storage, mfi->path, mfi->name, unread);
}
}
@@ -109,7 +107,6 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
{
struct _folder_info *mfi;
char *type;
- int unread = fi->unread_message_count;
LOCK(info_lock);
mfi = g_hash_table_lookup(si->folders, fi->full_name);
@@ -118,7 +115,7 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
update_1folder(mfi, fi);
} else {
/* always 'add it', but only 'add it' to non-local stores */
- d(printf("Adding new folder: %s (%s)\n", fi->path, fi->url));
+ d(printf("Adding new folder: %s (%s) %d unread\n", fi->path, fi->url, fi->unread_message_count));
mfi = g_malloc0(sizeof(*mfi));
mfi->path = g_strdup(fi->path);
mfi->name = g_strdup(fi->name);
@@ -128,6 +125,8 @@ setup_folder(CamelFolderInfo *fi, struct _store_info *si)
UNLOCK(info_lock);
if (si->storage != NULL) {
+ int unread = (fi->unread_message_count==-1)?0:fi->unread_message_count;
+
type = (strncmp(fi->url, "vtrash:", 7)==0)?"vtrash":"mail";
evolution_storage_new_folder(si->storage, mfi->path, mfi->name, type,
fi->url, mfi->name, unread);
@@ -339,5 +338,5 @@ mail_note_store(CamelStore *store, EvolutionStorage *storage, GNOME_Evolution_St
UNLOCK(info_lock);
- mail_msg_wait(mail_get_folderinfo(store, update_folders, si));
+ mail_get_folderinfo(store, update_folders, si);
}