aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/messageview.c20
-rw-r--r--src/summaryview.c6
2 files changed, 17 insertions, 9 deletions
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);