aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/messageview.c20
-rw-r--r--src/summaryview.c6
3 files changed, 23 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 5ad425d9..e3ae5b41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-11
+
+ * src/messageview.c: add .eml extension like summary_save_as().
+ * src/summaryview.c: summary_set_row(): show as '(No Subject)'
+ when subject is empty string.
+
2012-01-06
* src/inc.c
diff --git a/src/messageview.c b/src/messageview.c
index 911efb4d..0d28b78a 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2011 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2012 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -756,19 +756,27 @@ void messageview_save_as(MessageView *messageview)
if (!messageview->msginfo) return;
msginfo = messageview->msginfo;
- if (msginfo->subject) {
- filename = g_strdup(msginfo->subject);
- subst_for_filename(filename);
+ if (msginfo->subject && *msginfo->subject) {
+ filename = g_strdup_printf("%s.eml", msginfo->subject);
+ } else {
+ filename = g_strdup_printf("%u.eml", msginfo->msgnum);
}
+ subst_for_filename(filename);
dest = filesel_save_as(filename);
+
g_free(filename);
- if (!dest) return;
+ if (!dest)
+ return;
src = procmsg_get_message_file(msginfo);
if (copy_file(src, dest, TRUE) < 0) {
+ gchar *utf8_dest;
+
+ utf8_dest = conv_filename_to_utf8(dest);
alertpanel_error(_("Can't save the file `%s'."),
- g_basename(dest));
+ g_basename(utf8_dest));
+ g_free(utf8_dest);
}
g_free(src);
diff --git a/src/summaryview.c b/src/summaryview.c
index b3393709..d6499ee2 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -2435,7 +2435,7 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter,
sw_from_s = g_strconcat("-->", msginfo->to, NULL);
}
- if (msginfo->subject) {
+ if (msginfo->subject && *msginfo->subject) {
if (msginfo->folder && msginfo->folder->trim_summary_subject) {
subject_s = g_strdup(msginfo->subject);
trim_subject(subject_s);
@@ -2500,7 +2500,7 @@ static void summary_set_row(SummaryView *summaryview, GtkTreeIter *iter,
S_COL_UNREAD, unread_pix,
S_COL_MIME, mime_pix,
S_COL_SUBJECT, subject_s ? subject_s :
- msginfo->subject ? msginfo->subject :
+ msginfo->subject && *msginfo->subject ? msginfo->subject :
_("(No Subject)"),
S_COL_FROM, sw_from_s ? sw_from_s :
msginfo->fromname ? msginfo->fromname :
@@ -3897,7 +3897,7 @@ void summary_save_as(SummaryView *summaryview)
GET_MSG_INFO(msginfo, &iter);
if (!msginfo) return;
- if (msginfo->subject) {
+ if (msginfo->subject && *msginfo->subject) {
filename = g_strdup_printf("%s.eml", msginfo->subject);
} else {
filename = g_strdup_printf("%u.eml", msginfo->msgnum);