Bug 410538 - Show tagged files and folders first/before untagged ones
Summary: Show tagged files and folders first/before untagged ones
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: view-engine: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: junior-jobs, usability
Depends on:
Blocks:
 
Reported: 2019-08-03 13:35 UTC by george fb
Modified: 2019-09-01 17:58 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 19.11.80


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description george fb 2019-08-03 13:35:08 UTC
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
Comment 1 Christoph Feck 2019-08-20 19:11:38 UTC
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
Comment 2 Nazar Kalinowski 2019-08-26 18:10:24 UTC
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?
Comment 3 Elvis Angelaccio 2019-09-01 15:54:21 UTC
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