From: Christoph Hohmann Date: Sun, 15 Jul 2001 01:30:58 +0000 (+0000) Subject: fixed folder stats update after incorporation X-Git-Tag: VERSION_0_5_0_CLAWS5~9 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=3974bbf03e94331b3e7e12881e2712c9a0ad7ba3 fixed folder stats update after incorporation --- diff --git a/ChangeLog.claws b/ChangeLog.claws index 5a1809b98..26a3b67ce 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,8 @@ +2001-07-15 [christoph] + + * src/procmsg.c + fixed folder stats update after incorporation + 2001-07-15 [alfons] * src/summaryview.c diff --git a/src/procmsg.c b/src/procmsg.c index 3a3b0e32b..f2631852c 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "intl.h" #include "main.h" @@ -433,6 +434,8 @@ static GHashTable *procmsg_read_mark_file(const gchar *folder) GHashTable *mark_table = NULL; gint num; MsgFlags flags; + gchar *msgfile; + struct stat s; if ((fp = procmsg_open_mark_file(folder, FALSE)) == NULL) return NULL; @@ -441,11 +444,16 @@ static GHashTable *procmsg_read_mark_file(const gchar *folder) while (fread(&num, sizeof(num), 1, fp) == 1) { if (fread(&flags, sizeof(flags), 1, fp) != 1) break; - MSG_SET_FLAGS(flags, MSG_CACHED); - g_hash_table_insert(mark_table, - GUINT_TO_POINTER(num), - GUINT_TO_POINTER(flags)); + msgfile = g_strdup_printf("%s%c%d", folder, G_DIR_SEPARATOR, num); + if(stat(msgfile, &s) == 0 && S_ISREG(s.st_mode)) { + MSG_SET_FLAGS(flags, MSG_CACHED); + + g_hash_table_insert(mark_table, + GUINT_TO_POINTER(num), + GUINT_TO_POINTER(flags)); + } + free(msgfile); } fclose(fp);