+2007-09-26 [colin] 3.0.1cvs32
+
+ * src/messageview.c
+ * src/procmsg.c
+ * src/procmsg.h
+ Optimisation: avoid fetching mail 3 times locally
+ for displaying
+
2007-09-26 [colin] 3.0.1cvs31
* src/mh.c
( cvs diff -u -r 1.149.2.82 -r 1.149.2.83 src/inc.c; ) > 3.0.1cvs29.patchset
( cvs diff -u -r 1.213.2.162 -r 1.213.2.163 src/folder.c; cvs diff -u -r 1.87.2.48 -r 1.87.2.49 src/folder.h; cvs diff -u -r 1.79.2.61 -r 1.79.2.62 src/mh.c; cvs diff -u -r 1.9.2.7 -r 1.9.2.8 src/mh.h; ) > 3.0.1cvs30.patchset
( cvs diff -u -r 1.79.2.62 -r 1.79.2.63 src/mh.c; ) > 3.0.1cvs31.patchset
+( cvs diff -u -r 1.94.2.152 -r 1.94.2.153 src/messageview.c; cvs diff -u -r 1.150.2.102 -r 1.150.2.103 src/procmsg.c; cvs diff -u -r 1.60.2.48 -r 1.60.2.49 src/procmsg.h; ) > 3.0.1cvs32.patchset
MICRO_VERSION=1
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=31
+EXTRA_VERSION=32
EXTRA_RELEASE=
EXTRA_GTK2_VERSION=
procmsg_spam_can_learn());
}
messageview->updating = TRUE;
- mimeinfo = procmime_scan_message(msginfo);
+
+ file = procmsg_get_message_file_path(msginfo);
+ if (!file) {
+ g_warning("can't get message file path.\n");
+ textview_show_error(messageview->mimeview->textview);
+ return -1;
+ }
+
+ if (!folder_has_parent_of_type(msginfo->folder, F_QUEUE) &&
+ !folder_has_parent_of_type(msginfo->folder, F_DRAFT))
+ mimeinfo = procmime_scan_file(file);
+ else
+ mimeinfo = procmime_scan_queue_file(file);
+
messageview->updating = FALSE;
if (messageview->deferred_destroy) {
+ g_free(file);
messageview_destroy(messageview);
return 0;
}
break;
}
}
-
- messageview->updating = TRUE;
- file = procmsg_get_message_file_path(msginfo);
- messageview->updating = FALSE;
-
- if (messageview->deferred_destroy) {
- g_free(file);
- messageview_destroy(messageview);
- return 0;
- }
-
- if (!file) {
- g_warning("can't get message file path.\n");
- procmime_mimeinfo_free_all(mimeinfo);
- textview_show_error(messageview->mimeview->textview);
- return -1;
- }
-
+
if (messageview->msginfo != msginfo) {
procmsg_msginfo_free(messageview->msginfo);
messageview->msginfo = NULL;
messageview_set_menu_sensitive(messageview);
- messageview->msginfo = procmsg_msginfo_get_full_info(msginfo);
+ messageview->msginfo =
+ procmsg_msginfo_get_full_info_from_file(msginfo, file);
if (!messageview->msginfo)
messageview->msginfo = procmsg_msginfo_copy(msginfo);
} else {
return newmsginfo;
}
-MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
+MsgInfo *procmsg_msginfo_get_full_info_from_file(MsgInfo *msginfo, const gchar *file)
{
MsgInfo *full_msginfo;
- gchar *file;
if (msginfo == NULL) return NULL;
- file = procmsg_get_message_file_path(msginfo);
- if (!file || !is_file_exist(file)) {
- g_free(file);
- file = procmsg_get_message_file(msginfo);
- }
if (!file || !is_file_exist(file)) {
- g_warning("procmsg_msginfo_get_full_info(): can't get message file.\n");
+ g_warning("procmsg_msginfo_get_full_info_from_file(): can't get message file.\n");
return NULL;
}
full_msginfo = procheader_parse_file(file, msginfo->flags, TRUE, FALSE);
- g_free(file);
if (!full_msginfo) return NULL;
msginfo->total_size = full_msginfo->total_size;
return procmsg_msginfo_new_ref(msginfo);
}
+MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
+{
+ MsgInfo *full_msginfo;
+ gchar *file;
+
+ if (msginfo == NULL) return NULL;
+
+ file = procmsg_get_message_file_path(msginfo);
+ if (!file || !is_file_exist(file)) {
+ g_free(file);
+ file = procmsg_get_message_file(msginfo);
+ }
+ if (!file || !is_file_exist(file)) {
+ g_warning("procmsg_msginfo_get_full_info(): can't get message file.\n");
+ return NULL;
+ }
+
+ full_msginfo = procmsg_msginfo_get_full_info_from_file(msginfo, file);
+ g_free(file);
+ return full_msginfo;
+}
+
void procmsg_msginfo_free(MsgInfo *msginfo)
{
if (msginfo == NULL) return;
MsgInfo *procmsg_msginfo_new_ref (MsgInfo *msginfo);
MsgInfo *procmsg_msginfo_copy (MsgInfo *msginfo);
MsgInfo *procmsg_msginfo_get_full_info (MsgInfo *msginfo);
+MsgInfo *procmsg_msginfo_get_full_info_from_file
+ (MsgInfo *msginfo,
+ const gchar *file);
void procmsg_msginfo_free (MsgInfo *msginfo);
guint procmsg_msginfo_memusage (MsgInfo *msginfo);