Bug 391527 - After disabling "History" in settings, Gwenview still remembers last used folder
Summary: After disabling "History" in settings, Gwenview still remembers last used folder
Status: RESOLVED FIXED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 17.12.2
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2018-03-07 16:01 UTC by Oded Arbel
Modified: 2018-05-09 06:33 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oded Arbel 2018-03-07 16:01:08 UTC
A recent (17.12?) feature was that Gwenview remembers the last folder used for Move/Copy/Link dialogs.

This functionality seems to be related to the "History" checkbox under Settings -> Configure Gwenview -> Advanced (if not, then I have no idea what else it may refer to), but after unchecking that option, Gwenview still offers the last used folder by default on Move/Copy/Link dialogs.

I preferred the previous behavior where Gwenview's Move/Copy/Link dialogs would start in the folder containing the file to be moved/copied/linked, and would like to have an option of reverting to that.
Comment 1 null 2018-03-07 23:22:44 UTC
> A recent (17.12?) feature was that Gwenview remembers the last folder
> used for Move/Copy/Link dialogs.
That was a bug fix, restoring functionality working in an older version before the feature broke by changes to other libraries

> This functionality seems to be related to the "History" checkbox under 
> Settings -> Configure Gwenview -> Advanced
> (if not, then I have no idea what else it may refer to)
The checkbox affects the Start Page in a quite obvious way once you check it.

> after unchecking that option, Gwenview still offers the last used folder by
> default on Move/Copy/Link dialogs.
I guess we could think about letting the checkbox affect those dialogs too. After all, this would be similar to Bug 332853.

It does not sound too complicated to implement (access the history setting before saving the path, clear the setting from the config when closing the config dialog).

> I preferred the previous behavior where Gwenview's Move/Copy/Link dialogs
> would start in the folder containing the file to be moved/copied/linked, and
> would like to have an option of reverting to that.
No, sorry. There won't be a separate option for configuring that, apart from the history checkbox maybe.

Perhaps we should change the default location to the current folder though, instead of using the Pictures folder.
Comment 2 Oded Arbel 2018-03-08 14:16:18 UTC
I actually never opened gwenview not with a file parameter... but now that I did, yes - it is obvious what the "History" checkbox does. 

Also I didn't know that Move/Copy/Link supposed to default to the Pictures folder - I've never seen that happen, and it doesn't make much sense to me: I can see how using the last moved to folder is useful, as well as the current file's directory, but not the arbitrary XDG folder.

I think it would be great if the "History" checkbox also affects the default folder for Move/Copy/Link dialogs to remember or not the last folder used.
Comment 3 Peter Mühlenpfordt 2018-03-14 08:06:06 UTC
Git commit fee2942254d630a042f3d9a536da8b97bc84478a by Peter Mühlenpfordt.
Committed on 14/03/2018 at 08:03.
Pushed by muhlenpfordt into branch 'master'.

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

Summary:
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.

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: https://phabricator.kde.org/D11280

M  +6    -1    app/fileoperations.cpp
M  +1    -1    lib/contextmanager.cpp
M  +0    -3    lib/gwenviewconfig.kcfg

https://commits.kde.org/gwenview/fee2942254d630a042f3d9a536da8b97bc84478a
Comment 4 Peter Mühlenpfordt 2018-03-14 08:25:48 UTC
Git commit 8bd2f625c67966ed9d32f98c74f769caf56f6fdd by Peter Mühlenpfordt.
Committed on 14/03/2018 at 08:22.
Pushed by muhlenpfordt into branch 'master'.

Prevent saving Recent Files and LastTargetDir if history is disabled

Summary:
Disabling history in {nav Settings > Configure > Advanced > History}
does not prevent showing and populating {nav File > Open Recent}.
The last target directory for Copy/Move/Link To dialog does not check
for history option too.
This patch only saves/restores file history if the option is enabled
and hides the menu entry if disabled.
Related: bug 332853

Depends on D11280

Test Plan:
* Enable/disable history option
* Open some images/folders in Gwenview
* Copy/Move/Link To some images
* Check if history is (not) saved/restored according to option value

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx

Differential Revision: https://phabricator.kde.org/D11263

M  +10   -4    app/mainwindow.cpp
M  +2    -1    lib/contextmanager.cpp

https://commits.kde.org/gwenview/8bd2f625c67966ed9d32f98c74f769caf56f6fdd
Comment 5 Oded Arbel 2018-05-09 06:33:54 UTC
Looks to be working great in Gwenview 18.07.70. Thanks!