Bug 466836 - Add a sort option "As in Dolphin" in the available sorting options; Sorting is not followed Dolphin in some cases.
Summary: Add a sort option "As in Dolphin" in the available sorting options; Sorting i...
Status: CONFIRMED
Alias: None
Product: gwenview
Classification: Applications
Component: general (show other bugs)
Version: 22.12.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Gwenview Bugs
URL:
Keywords:
: 457718 462691 465617 (view as bug list)
Depends on:
Blocks: 473661
  Show dependency treegraph
 
Reported: 2023-03-04 15:36 UTC by tobias
Modified: 2024-08-31 20:27 UTC (History)
9 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tobias 2023-03-04 15:36:45 UTC
SUMMARY
Follow-up to: https://bugs.kde.org/show_bug.cgi?id=236059

In some cases the sort order is not used correctly.
E.g. I use the following setting in Dolphin:
- sort by date of creation, oldest first, folders first

The pictures in Gwenview are sorted completely different.

STEPS TO REPRODUCE
1. Open a picture with Gwenview.
2. Click on Overview-Menu in Gwenview.

OBSERVED RESULT
Sort order is different.

EXPECTED RESULT
Sort order should be the same as dolphin.

SOFTWARE/OS VERSIONS
Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.2
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8
Kernel Version: 6.1.14-1-MANJARO (64-bit)
Graphics Platform: Wayland
Graphics Processor: NVIDIA GeForce

Dolphin Version: 22.12.3


ADDITIONAL INFORMATION
Comment 1 tobias 2023-03-04 15:41:15 UTC
Also: An option would be great, whether a user wants to use the dolphin setting or not.
Comment 2 Andrew Shark 2023-08-22 17:06:23 UTC
I could only see the sorting follows Dolphin when sorted by (in both ascending and descending) Name, Size, Rating. 

The Gwenview has also a "Date" sorting, but it is not clear what date. Date of file creation in file system? Date from some field in EXIF? Some other date? I could not recognize that by trying to sort by some date fields with dolphin. This also need clarification.

The fix in BUG 236059 should not assume that user sorts only by mentioned three fields. In the Dolphin user can sort for example by "file user group", and still want the order to be followed in Gwenview.

Also, in the Gwenview's sorting options, there should be an entry for "As in Dolphin". Because currently, when you open image from Dolphin, the state of the radio button is meaningless.

Operating System: Arch Linux 
KDE Plasma Version: 5.27.7
KDE Frameworks Version: 5.108.0
Qt Version: 5.15.10
Graphics Platform: Wayland
Gwenview: 23.07.80
Comment 3 Andrew Shark 2023-08-22 17:10:34 UTC
*** Bug 462691 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Shark 2023-08-22 18:49:27 UTC
*** Bug 465617 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Shark 2023-08-22 21:04:48 UTC
*** Bug 457718 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Shark 2023-08-23 00:03:34 UTC
Looks like date is messy (a mix of EXIF data and file date), see Bug 242332
Comment 7 Méven Car 2023-09-08 05:44:10 UTC
Git commit 18b905d34cbd012870fffecba623844384e30048 by Méven Car, on behalf of Oded Arbel.
Committed on 08/09/2023 at 07:43.
Pushed by meven into branch 'master'.

Sync sort order with file manager not only on initial launch

If we obey the file manager sort mode, we should track that when navigating to other folders.

Also make sure that if the user chooses a sorting mode themselves - we stop tracking the file manager sort mode.
Related: bug 36059, bug 443168

M  +1    -0    app/browsemainpage.cpp
M  +10   -0    app/gvcore.cpp
M  +5    -0    app/gvcore.h
M  +63   -48   app/mainwindow.cpp
M  +1    -0    app/mainwindow.h

https://invent.kde.org/graphics/gwenview/-/commit/18b905d34cbd012870fffecba623844384e30048
Comment 8 Oded Arbel 2023-09-08 09:27:39 UTC
Please note that the recent change is not a fix for the "select sort by option does not track dolphin", its just about making sure the sorting according to the file manager sort mode continues to be tracked when changing directories.

I think what we're missing here is a new "Sort by" sub-menu option of "File manager (<current-order>)". I'll see about working on that next.
Comment 9 Oded Arbel 2023-09-08 11:03:32 UTC
(In reply to Andrew Shark from comment #2)
> The Gwenview has also a "Date" sorting, but it is not clear what date. Date
> of file creation in file system? Date from some field in EXIF? Some other
> date? I could not recognize that by trying to sort by some date fields with
> dolphin. This also need clarification.

The sort by date option in Gwenview - and to the best of my understanding the only thing it can do when it wants to sort by the file manager's "date" sorting - is to sort by the file system's "modified date". Nothing else makes much sense - IMHO.

This new commit - https://invent.kde.org/graphics/gwenview/-/commit/6545c47de9fdf830739737c52cbeaa2ce6a6411c - adds metadata fields for "created date" and "accessed date" - which, in my opinion, only exemplifies how much these fields are useless and serve only to confuse and do not add much information:
* "accessed date" is always "now", because you just accessed the file to show it in gwenview (or thumbnail it or anything). "accessed date" is pretty much useless unless you have some non-interactive process that only scans directory listing.
* "created date" is the time the file was physically created on the file system - which can be newer than "modified date" (for example when copying the file from another storage medium), or can be unset (some file systems don't have that feature).
* "exif date" is optional and a lot of images do not have it - or even being able to store it, so sorting by that is going to be hit and miss (and that is a lot of miss). A good image importer might set the file info modified date according to the EXIF data, which is what I actually expect from all digital cameras and everything that generates EXIF date fields.