diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-12-07 10:17:56 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-12-07 10:17:56 +0000 |
commit | 168a914e917f0c6b336a1a0f2f3d08e35c001d31 (patch) | |
tree | 8637dd8814aab1f37b0adf853e7ebeaca494d110 /libsylph/procmsg.c | |
parent | 98bc6b1b9afbee2d32baf91c42906a739aba3f8d (diff) |
update caches and flags when reading message list from a folder.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@806 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/procmsg.c')
-rw-r--r-- | libsylph/procmsg.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libsylph/procmsg.c b/libsylph/procmsg.c index 6c5f59fd..e93774ba 100644 --- a/libsylph/procmsg.c +++ b/libsylph/procmsg.c @@ -489,6 +489,53 @@ void procmsg_write_flags(MsgInfo *msginfo, FILE *fp) WRITE_CACHE_DATA_INT(flags, fp); } +void procmsg_write_cache_list(FolderItem *item, GSList *mlist) +{ + FILE *fp; + GSList *cur; + + g_return_if_fail(item != NULL); + + debug_print("Writing summary cache (%s)\n", item->path); + + fp = procmsg_open_cache_file(item, DATA_WRITE); + if (fp == NULL) + return; + + for (cur = mlist; cur != NULL; cur = cur->next) { + MsgInfo *msginfo = (MsgInfo *)cur->data; + procmsg_write_cache(msginfo, fp); + } + + fclose(fp); + item->cache_dirty = FALSE; +} + +void procmsg_write_flags_list(FolderItem *item, GSList *mlist) +{ + FILE *fp; + GSList *cur; + + g_return_if_fail(item != NULL); + + debug_print("Writing summary flags (%s)\n", item->path); + + fp = procmsg_open_mark_file(item, DATA_WRITE); + if (fp == NULL) + return; + + for (cur = mlist; cur != NULL; cur = cur->next) { + MsgInfo *msginfo = (MsgInfo *)cur->data; + procmsg_write_flags(msginfo, fp); + } + + if (item->mark_queue) + procmsg_flush_mark_queue(item, fp); + + fclose(fp); + item->mark_dirty = FALSE; +} + void procmsg_flush_mark_queue(FolderItem *item, FILE *fp) { MsgInfo *flaginfo; |