[Commits] [SCM] claws branch, master, updated. 3.17.3-97-ge8df862
claws at claws-mail.org
claws at claws-mail.org
Thu Feb 14 15:12:41 CET 2019
The branch, master has been updated
via e8df8623efe9da6b728765ff800780c420bb2aab (commit)
from 6438002de6a489ff0836d5a5d60ff03b5c4e4a1e (commit)
Summary of changes:
src/messageview.c | 48 +-----------------------------------------------
src/summaryview.c | 17 +++++++++++++++--
2 files changed, 16 insertions(+), 49 deletions(-)
- Log -----------------------------------------------------------------
commit e8df8623efe9da6b728765ff800780c420bb2aab
Author: Paul <paul at claws-mail.org>
Date: Thu Feb 14 14:12:35 2019 +0000
fix bug 4155, 'remember directory of last saving'
drop messageview_save_as(), use only summary_save_as()
diff --git a/src/messageview.c b/src/messageview.c
index fe9767d..62d63ad 100644
--- a/src/messageview.c
+++ b/src/messageview.c
@@ -1813,52 +1813,6 @@ gboolean messageview_is_visible(MessageView *messageview)
return messageview->visible;
}
-static void messageview_save_as(MessageView *messageview)
-{
- gchar *filename = NULL;
- MsgInfo *msginfo;
- gchar *src, *dest, *tmp;
-
- if (!messageview->msginfo) return;
- msginfo = messageview->msginfo;
-
- if (msginfo->subject) {
- Xstrdup_a(filename, msginfo->subject, return);
- subst_for_filename(filename);
- }
- if (filename && !g_utf8_validate(filename, -1, NULL)) {
- gchar *oldstr = filename;
- filename = conv_codeset_strdup(filename,
- conv_get_locale_charset_str(),
- CS_UTF_8);
- if (!filename) {
- g_warning("messageview_save_as(): failed to convert character set.");
- filename = g_strdup(oldstr);
- }
- dest = filesel_select_file_save(_("Save as"), filename);
- g_free(filename);
- } else
- dest = filesel_select_file_save(_("Save as"), filename);
- if (!dest) return;
- if (is_file_exist(dest)) {
- AlertValue aval;
-
- aval = alertpanel(_("Overwrite"),
- _("Overwrite existing file?"),
- GTK_STOCK_CANCEL, GTK_STOCK_OK, NULL, ALERTFOCUS_FIRST);
- if (G_ALERTALTERNATE != aval) return;
- }
-
- src = procmsg_get_message_file(msginfo);
- if (copy_file(src, dest, TRUE) < 0) {
- tmp = g_path_get_basename(dest);
- alertpanel_error(_("Couldn't save the file '%s'."), tmp);
- g_free(tmp);
- }
- g_free(dest);
- g_free(src);
-}
-
static gint messageview_delete_cb(GtkWidget *widget, GdkEventAny *event,
MessageView *messageview)
{
@@ -2199,7 +2153,7 @@ gchar *messageview_get_selection(MessageView *msgview)
static void save_as_cb(GtkAction *action, gpointer data)
{
MessageView *messageview = (MessageView *)data;
- messageview_save_as(messageview);
+ summary_save_as(messageview->mainwin->summaryview);
}
static void print_mimeview(MimeView *mimeview, gint sel_start, gint sel_end, gint partnum)
diff --git a/src/summaryview.c b/src/summaryview.c
index 99b30c8..59bd9d6 100644
--- a/src/summaryview.c
+++ b/src/summaryview.c
@@ -4995,6 +4995,7 @@ void summary_save_as(SummaryView *summaryview)
gchar *filename = NULL;
gchar *src, *dest;
gchar *tmp;
+ gchar *filedir = NULL;
AlertValue aval = 0;
@@ -5018,12 +5019,17 @@ void summary_save_as(SummaryView *summaryview)
g_warning("summary_save_as(): failed to convert character set.");
filename = g_strdup(oldstr);
}
- dest = filesel_select_file_save(_("Save as"), filename);
+ dest = filename;
g_free(filename);
} else
- dest = filesel_select_file_save(_("Save as"), filename);
+ dest = filename;
filename = NULL;
if (!dest) return;
+ if (prefs_common.attach_save_dir && *prefs_common.attach_save_dir)
+ dest = g_strconcat(prefs_common.attach_save_dir, G_DIR_SEPARATOR_S,
+ dest, NULL);
+ dest = filesel_select_file_save(_("Save as"), dest);
+
if (is_file_exist(dest)) {
aval = alertpanel(_("Append or Overwrite"),
_("Append or overwrite existing file?"),
@@ -5060,6 +5066,13 @@ void summary_save_as(SummaryView *summaryview)
}
g_free(src);
}
+
+ filedir = g_path_get_dirname(dest);
+ if (filedir && strcmp(filedir, ".")) {
+ g_free(prefs_common.attach_save_dir);
+ prefs_common.attach_save_dir = g_filename_to_utf8(filedir, -1, NULL, NULL, NULL);
+ }
+
g_free(dest);
g_free(tmp);
}
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list