SUMMARY Add option to show tagged files and folders first when sorting by tags. I use tags, show in groups and sort by tags to easily find certain files, but since tagged files are shown after untagged ones I have to tag everything in a folder and if new files are added I have to keep tagging them. Showing tags first would make things easier as I would only tag files I want to tag and I won't have to keep tagging new files. Also currently the order is untagged folders, tagged folders, untagged files, tagged files. It would be better if it were tagged folders, tagged files, untagged folders, untagged files. STEPS TO REPRODUCE 1. Tag files 2. Show in groups 3. Sort by tags OBSERVED RESULT Tagged files come after untagged files EXPECTED RESULT Tagged files come before untagged files SOFTWARE/OS VERSIONS Linux/KDE Plasma: Solus 4.0 (available in About System) KDE Plasma Version: 5.16.3 KDE Frameworks Version: 5.60.0 Qt Version: 5.13
I guess the issue is also with other textual columns, such as Artist, Comment, etc.). For all those textual columns, an empty string could always sort after a non-empty string, even in reverse sorting mode. Compariso code is in https://cgit.kde.org/dolphin.git/tree/src/kitemviews/kfileitemmodel.cpp#n1741
I wrote a patch (probably an awful one, because I'm not a C++ dev) with a fix for that. With this patch tagged folders come before untagged and tagged files come before untagged files, and I think the same applies to "other textual columns, such as Artist, Comment, etc". Should I try to submit it, or should I try to add a setting to make this behavior optional, not default?
Git commit 7f6d49377b3b66da9811d94aa0166872e4f44836 by Elvis Angelaccio, on behalf of Nazar Kalinowski. Committed on 01/09/2019 at 15:50. Pushed by elvisangelaccio into branch 'master'. Make non-empty textual columns come first in sorting Summary: Current behavior of dolphin in sorting of files with textual columns (e.g. tags) is to show files without this particular textual column (e.g. without tags) first. This patch changes this behavior so that dolphin shows the files with some value before the files without any value for chosen sorting method. Test Plan: Sorting by name (isn't affected by the patch): https://i.imgur.com/eqbYwyZ.png Sorting by textual column ("tags" in this particular example), old version (non-tagged files and folders come first): https://i.imgur.com/5KLLujU.png patched version (tagged files and folders come first): https://i.imgur.com/oUAeZ2z.png Reviewers: #dolphin, #vdg, ngraham Reviewed By: #dolphin, #vdg, ngraham Subscribers: elvisangelaccio, ngraham, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D23482 M +9 -2 src/kitemviews/kfileitemmodel.cpp https://commits.kde.org/dolphin/7f6d49377b3b66da9811d94aa0166872e4f44836