From: Christoph Hohmann Date: Thu, 25 Sep 2003 13:01:59 +0000 (+0000) Subject: 0.9.5claws29 X-Git-Tag: ch_branch_last_merge~9 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=966f25474561b2dab1241b05c32e0e753ed50299 0.9.5claws29 * src/folder.c o don't fetch source message to get it's message id o immediately scan dest folder when copying a message did not return a new message number and not do it when the first message without a new message number is found --- diff --git a/ChangeLog.claws b/ChangeLog.claws index d16755c90..b48dc8773 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -1,3 +1,11 @@ +2003-09-25 [christoph] 0.9.5claws29 + + * src/folder.c + o don't fetch source message to get it's message id + o immediately scan dest folder when copying a message did not + return a new message number and not do it when the first message + without a new message number is found + 2003-09-23 [christoph] 0.9.5claws28 * src/compose.c diff --git a/configure.ac b/configure.ac index 1edcb60f6..8541471d3 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=9 MICRO_VERSION=5 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=28 +EXTRA_VERSION=29 if test $EXTRA_VERSION -eq 0; then VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}claws else diff --git a/src/folder.c b/src/folder.c index c87d558b8..216892410 100644 --- a/src/folder.c +++ b/src/folder.c @@ -1987,6 +1987,7 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour relation = g_relation_new(2); g_relation_index(relation, 0, g_direct_hash, g_direct_equal); + g_relation_index(relation, 1, g_direct_hash, g_direct_equal); /* * Copy messages to destination folder and @@ -2013,6 +2014,11 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour * Fetch new MsgInfos for new messages in dest folder, * add them to the msgcache and update folder message counts */ + if (g_relation_count(relation, GINT_TO_POINTER(0), 1) > 0) { + folder_item_scan_full(dest, FALSE); + folderscan = TRUE; + } + for (l = msglist; l != NULL; l = g_slist_next(l)) { MsgInfo *msginfo = (MsgInfo *) l->data; GTuples *tuples; @@ -2024,32 +2030,19 @@ static gint do_copy_msgs(FolderItem *dest, GSList *msglist, gboolean remove_sour if (num >= 0) { MsgInfo *newmsginfo; - if (num == 0) { - gchar *file; - - if (!folderscan) { - folder_item_scan_full(dest, FALSE); - folderscan = TRUE; - } - file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum); - num = folder_item_get_msg_num_by_file(dest, file); - g_free(file); + if (folderscan) { + newmsginfo = folder_item_get_msginfo_by_msgid(dest, msginfo->msgid); + copy_msginfo_flags(msginfo, newmsginfo); + num = newmsginfo->msgnum; + procmsg_msginfo_free(newmsginfo); + } else { + newmsginfo = folder->klass->get_msginfo(folder, dest, num); + add_msginfo_to_cache(dest, newmsginfo, msginfo); + procmsg_msginfo_free(newmsginfo); } if (num > lastnum) lastnum = num; - - if (num == 0) - continue; - - if (!folderscan && - ((newmsginfo = folder->klass->get_msginfo(folder, dest, num)) != NULL)) { - add_msginfo_to_cache(dest, newmsginfo, msginfo); - procmsg_msginfo_free(newmsginfo); - } else if ((newmsginfo = msgcache_get_msg(dest->cache, num)) != NULL) { - copy_msginfo_flags(msginfo, newmsginfo); - procmsg_msginfo_free(newmsginfo); - } } }