Expand Dolphin grouping

Submitting a feature request, since I think the bug tracker doesn’t seem like the right place.

Right now if I set up grouping in Dolphin there are a few usability issues.

One it’s buried one level too deep for my taste, but you can get around that by adding it to the toolbar, showing the menubar… yay for KDE and customisation.

The other issue is that grouping mostly makes sense to do by name, and it doesn’t exactly do what you expect it to do.

It does do a simple alphabetical grouping by the initial letter. I suppose that’s useful if you’re trying to dig deeper into /usr/bin, but not exactly useful in the more common use case: entering a directory with many files with a common prefix, and a number.

Case in point, consider that you have a folder with multiple seasons of one show in a flat directory structure.

In theory grouping should extract the common prefix, like e.g. Season 1 and produce neat groups by e.g. season. In reality I get a single group S.

Fine, you’d say, then just strip off the prefix and use the plain number. Well… that doesn’t work either, because it then just shows 0-9 as a group title. Which to be quite honest is not as useful as if it at least applied the initial letter system consistently.

I think that it may be worth discussing grouping by common prefix.

I’d argue that there’s room for defining a smart grouping algorithm that is context sensitive and groups by different things depending on circumstance.

It is the ONLY right place. Sorry.

We do know kde.bugs.org is not great, and we want to improve the status-quo on that front, there is no-easy path unfortunately (or else we wouldn’t be talking here). But reporting bugs or asking for features are contributions and thus will require some level of effort always. If you are not willing to do it, maybe it is not that important. The drawback of this mind-set is we don’t get bugs for little issues that aren’t that important but that still matters and itches users.
But the fact is using kde.bugs.org is not that much harder than posting on discuss.kde.org, and you can be wrong, we do bug triage and edit bugs report if something is not right.

We can still discuss it here :grinning:
But that’s not an official feature request, the conversation will get forgotten once the discussion is done.

You can also add a shortcut, I set it to Ctrl+G personally. I am thinking about making it default.

We have more features than we allow ourselves to show in the root hamburger-menu. That’s a trade-off. By adding an entry to the toolbar, you did fix your need making dolphin more practical for you than using the menu even if it had been in the root hamburger-menu.

The main feature idea is good and not that hard to implement, could be a junior job. Nice to have the use-case this way we can discuss how to best fit it rather than just the feature proposal but that works and makes sense to me.

In one phrase:
Have grouping by-name taking into account common-prefix in group names

We could even do that for any column whose value is a string.

1 Like

So, would you mind if I created an MR with this?

I’d just like to know which branch to MR to, and if there are any convetions beyond the Qt conventions that I should follow?

1 Like

Yes please of course we welcome contributions !

A few, but you likely won’t have to deal with those as they concern edge-cases, we match Qt convention.
Generally follow the naming and style the current code base uses is the best advise I can give you and use clang-format.
Name your branch work/<username>/<my-feature-short-form> and target master branch in your MR.

I recommend you to use kdesrc_build to build dolphin, installing its dependencies from the distro should be fine if you use Neon or Arch, but you will need to compile a bunch of libs if your distro does not ship Plasma 6, KDE Frameworks 6.
Get Involved/development - KDE Community Wiki has the documentation.

Let me give you a pointer. You will be interested in KFileItemModel::groups function and adjusting KFileItemModel::nameRoleGroups and perhaps KFileItemModel::genericStringRoleGroups too. We have unit-tests for this KFileItemModelTest::testNameRoleGroups please add new test-cases for the new feature, it should help you be more productive.

1 Like

On that note, I noticed the copyright notice hasn’t been updated since 2022, is it intentional? Or can I just push it to 2024?

Target master branch.
Dolphin follows a backport-cherrypick workflow, we merge to master and backport sparingly to 24.02 bugfix.
This is clearly a behavior change so it should not get in 24.02 branch.

Dates in copyright notes are not about the right-claim but date of creation of content.

I’m glad I asked, before making a change

How do I iterate over the m_itemData in the sequence in which they are displayed. I understand that showing folders first doesn’t affect the sorting algorithm, it just changes the way the indices are displayed.

EDIT: Nevermind, the problem was a fault in the algo I came up with, this is still fine.

You can chat with KDE community on matrix to get answers.
The channels New Contributors, kde development or Dolphin (kde-fm) should be helpful :wink:
https://community.kde.org/Matrix