diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-05-27 10:57:37 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-05-27 10:57:37 +0000 |
commit | 0c58540309726e0e476d90ca9d488142a58b4fcd (patch) | |
tree | e66d05f06fe02ba193f1a63a69bcaee8dc8c6596 /src/imap.c | |
parent | 2ddb31bb4cf51711d786e1a994f2a91ed80e7cee (diff) |
optimized the writing of mark file.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@293 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/imap.c')
-rw-r--r-- | src/imap.c | 39 |
1 files changed, 30 insertions, 9 deletions
@@ -926,6 +926,7 @@ static GSList *imap_get_msg_list(Folder *folder, FolderItem *item, mlist = g_slist_remove(mlist, msginfo); procmsg_msginfo_free(msginfo); item->cache_dirty = TRUE; + item->mark_dirty = TRUE; continue; } @@ -934,27 +935,46 @@ static GSList *imap_get_msg_list(Folder *folder, FolderItem *item, item->unread++; MSG_SET_PERM_FLAGS(msginfo->flags, MSG_UNREAD); + item->mark_dirty = TRUE; } } else { - if (MSG_IS_NEW(msginfo->flags)) + if (MSG_IS_NEW(msginfo->flags)) { item->new--; - if (MSG_IS_UNREAD(msginfo->flags)) + item->mark_dirty = TRUE; + } + if (MSG_IS_UNREAD(msginfo->flags)) { item->unread--; + item->mark_dirty = TRUE; + } MSG_UNSET_PERM_FLAGS(msginfo->flags, MSG_NEW|MSG_UNREAD); } if (IMAP_IS_FLAGGED(imap_flags)) { - MSG_SET_PERM_FLAGS(msginfo->flags, MSG_MARKED); + if (!MSG_IS_MARKED(msginfo->flags)) { + MSG_SET_PERM_FLAGS(msginfo->flags, + MSG_MARKED); + item->mark_dirty = TRUE; + } } else { - MSG_UNSET_PERM_FLAGS(msginfo->flags, - MSG_MARKED); + if (MSG_IS_MARKED(msginfo->flags)) { + MSG_UNSET_PERM_FLAGS(msginfo->flags, + MSG_MARKED); + item->mark_dirty = TRUE; + } } if (IMAP_IS_ANSWERED(imap_flags)) { - MSG_SET_PERM_FLAGS(msginfo->flags, MSG_REPLIED); + if (!MSG_IS_REPLIED(msginfo->flags)) { + MSG_SET_PERM_FLAGS(msginfo->flags, + MSG_REPLIED); + item->mark_dirty = TRUE; + } } else { - MSG_UNSET_PERM_FLAGS(msginfo->flags, - MSG_REPLIED); + if (MSG_IS_REPLIED(msginfo->flags)) { + MSG_UNSET_PERM_FLAGS(msginfo->flags, + MSG_REPLIED); + item->mark_dirty = TRUE; + } } } @@ -1015,7 +1035,8 @@ static GSList *imap_get_msg_list(Folder *folder, FolderItem *item, item->last_num = last_uid; - debug_print("cache_dirty: %d\n", item->cache_dirty); + debug_print("cache_dirty: %d, mark_dirty: %d\n", + item->cache_dirty, item->mark_dirty); catch: return mlist; |