<table><tr><td style="">hindenburg added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D18352">View Revision</a></tr></table><br /><div><div><p>Can you try this?</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="diff" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);"><span style="color: #000080">diff --git a/src/SaveHistoryTask.cpp b/src/SaveHistoryTask.cpp</span>
<span style="color: #000080">index a202914d..16ab661c 100644</span>
<span style="color: #a00000">--- a/src/SaveHistoryTask.cpp</span>
<span style="color: #00a000">+++ b/src/SaveHistoryTask.cpp</span>
<span style="color: #800080">@@ -26,12 +26,17 @@</span>
 
 #include <KMessageBox>
 #include <KLocalizedString>
<span style="color: #00a000">+#include <KSharedConfig></span>
<span style="color: #00a000">+#include <KConfig></span>
<span style="color: #00a000">+#include <KConfigGroup></span>
 
 #include "SessionManager.h"
 #include "Emulation.h"
 
 namespace Konsole {
 
<span style="color: #00a000">+QString SaveHistoryTask::_saveDialogRecentURL;</span>
<span style="color: #00a000">+</span>
 SaveHistoryTask::SaveHistoryTask(QObject* parent)
     : SessionTask(parent)
 {
<span style="color: #800080">@@ -45,9 +50,7 @@ void SaveHistoryTask::execute()</span>
     //        three then providing a URL for each one will be tedious
 
     // TODO - show a warning ( preferably passive ) if saving the history output fails
<span style="color: #a00000">-    QFileDialog* dialog = new QFileDialog(QApplication::activeWindow(),</span>
<span style="color: #a00000">-            QString(),</span>
<span style="color: #a00000">-            QDir::homePath());</span>
<span style="color: #00a000">+    QFileDialog* dialog = new QFileDialog(QApplication::activeWindow());</span>
     dialog->setAcceptMode(QFileDialog::AcceptSave);
 
     QStringList mimeTypes {
<span style="color: #800080">@@ -56,6 +59,20 @@ void SaveHistoryTask::execute()</span>
     };
     dialog->setMimeTypeFilters(mimeTypes);
 
<span style="color: #00a000">+    KSharedConfigPtr konsoleConfig = KSharedConfig::openConfig();</span>
<span style="color: #00a000">+    auto group = konsoleConfig->group("SaveHistory Settings");</span>
<span style="color: #00a000">+</span>
<span style="color: #00a000">+    if (_saveDialogRecentURL.isEmpty()) {</span>
<span style="color: #00a000">+        const auto list = group.readPathEntry("Recent URLs", QStringList());</span>
<span style="color: #00a000">+        if (list.isEmpty()) {</span>
<span style="color: #00a000">+            dialog->setDirectory(QDir::homePath());</span>
<span style="color: #00a000">+        } else {</span>
<span style="color: #00a000">+            dialog->setDirectoryUrl(QUrl(list.at(0)));</span>
<span style="color: #00a000">+        }</span>
<span style="color: #00a000">+    } else {</span>
<span style="color: #00a000">+        dialog->setDirectoryUrl(QUrl(_saveDialogRecentURL));</span>
<span style="color: #00a000">+    }</span>
<span style="color: #00a000">+</span>
     // iterate over each session in the task and display a dialog to allow the user to choose where
     // to save that session's history.
     // then start a KIO job to transfer the data from the history to the chosen URL
<span style="color: #800080">@@ -76,6 +93,10 @@ void SaveHistoryTask::execute()</span>
             continue;
         }
 
<span style="color: #00a000">+        // Save selected URL for next time</span>
<span style="color: #00a000">+        _saveDialogRecentURL = url.adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash).toString();</span>
<span style="color: #00a000">+        group.writePathEntry("Recent URLs", _saveDialogRecentURL);</span>
<span style="color: #00a000">+</span>
         KIO::TransferJob* job = KIO::put(url,
                                          -1,   // no special permissions
                                          // overwrite existing files
<span style="color: #000080">diff --git a/src/SaveHistoryTask.h b/src/SaveHistoryTask.h</span>
<span style="color: #000080">index c90c7e9e..65504d6f 100644</span>
<span style="color: #a00000">--- a/src/SaveHistoryTask.h</span>
<span style="color: #00a000">+++ b/src/SaveHistoryTask.h</span>
<span style="color: #800080">@@ -68,6 +68,8 @@ private:</span>
     };
 
     QHash<KJob *, SaveJob> _jobSession;
<span style="color: #00a000">+</span>
<span style="color: #00a000">+    static QString _saveDialogRecentURL;</span>
 };
 
 }</pre></div></div></div><br /><div><strong>REPOSITORY</strong><div><div>R319 Konsole</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D18352">https://phabricator.kde.org/D18352</a></div></div><br /><div><strong>To: </strong>guotao, Konsole<br /><strong>Cc: </strong>hindenburg, ngraham, mglb, konsole-devel, gennad, thsurrel, maximilianocuria<br /></div>