diff --git a/src/SaveHistoryTask.h b/src/SaveHistoryTask.h --- a/src/SaveHistoryTask.h +++ b/src/SaveHistoryTask.h @@ -68,6 +68,8 @@ }; QHash _jobSession; + + static QString _saveDialogFilePath; }; } diff --git a/src/SaveHistoryTask.cpp b/src/SaveHistoryTask.cpp --- a/src/SaveHistoryTask.cpp +++ b/src/SaveHistoryTask.cpp @@ -32,6 +32,8 @@ namespace Konsole { +QString SaveHistoryTask::_saveDialogFilePath = QDir::homePath(); + SaveHistoryTask::SaveHistoryTask(QObject* parent) : SessionTask(parent) { @@ -45,9 +47,10 @@ // three then providing a URL for each one will be tedious // TODO - show a warning ( preferably passive ) if saving the history output fails + QFileDialog* dialog = new QFileDialog(QApplication::activeWindow(), QString(), - QDir::homePath()); + _saveDialogFilePath.isEmpty() ? QDir::homePath() : _saveDialogFilePath); dialog->setAcceptMode(QFileDialog::AcceptSave); QStringList mimeTypes { @@ -76,6 +79,8 @@ continue; } + _saveDialogFilePath = url.toString(); + KIO::TransferJob* job = KIO::put(url, -1, // no special permissions // overwrite existing files