Commit fee29422 authored by Peter Mühlenpfordt's avatar Peter Mühlenpfordt

Set default path of "Copy/Move/Link To" dialog to current folder

D8785 introduced `QStandardPaths::PicturesLocation` as default
location for Copy/Move/Link To dialog.
This patch sets the starting folder to the current folder (where
the source image(s) resist). It also provides an easier handling
of switching off the history option in D11263.

CCBUG: 391527

Test Plan:
* Clear `LastTargetDir` config entry (e.g. remove `~/.config/gwenviewrc`)
* Start Gwenview
* Select one or more images and press {key F7} to copy
* Dialog should start in current folder

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Differential Revision:
parent d883cdcd
......@@ -96,7 +96,12 @@ static void copyMoveOrLink(Operation operation, const QList<QUrl>& urlList, QWid
dialog->setOption(QFileDialog::ShowDirsOnly, true);
QUrl dirUrl = contextManager->targetDirUrl();
if (!dirUrl.isValid()) {
dirUrl = urlList.constFirst().adjusted(QUrl::RemoveFilename|QUrl::StripTrailingSlash);
if (!dialog->exec()) {
......@@ -310,7 +310,7 @@ QUrl ContextManager::targetDirUrl() const
void ContextManager::setTargetDirUrl(const QUrl &url)
GV_RETURN_IF_FAIL(url.isEmpty() || url.isValid());
d->mTargetDirUrl = url;
......@@ -55,9 +55,6 @@
<entry name="LastTargetDir" type="Path">
<default code="true">
<entry name="ThumbnailBarOrientation" type="Enum">
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment