BUG: 182367
Add a Tags places item (tags:/) to Dolphin and file pickers by default if Baloo is enabled
dfaure | |
davidedmundson | |
ltoscano | |
broulik | |
elvisangelaccio | |
aacid | |
emmanuelp |
Frameworks | |
Dolphin |
BUG: 182367
Add a Tags places item (tags:/) to Dolphin and file pickers by default if Baloo is enabled
Tested this diff in up-to-date KDE Neon. If Baloo is enabled, by default a tags:/ places item appears in the Places view in both Dolphin and all file pickers:
Lint Skipped |
Unit Tests Skipped |
This is similar to the change in https://phabricator.kde.org/D7446. These hidden features are so powerful; we need to reveal them!
The one issue that I foresee with adding this is if a novice user clicks on it before any tags have been created, they might be slightly confused to see a blank view (since there are no tags). If this is approved, I'll work on adding some explanatory text to display instead of a blank white background. Something like "Tags are a way to categorize your files and folders for quick access. Any tags you create will appear here."
I tried entering "tags:/" in Dolphin, but got "Invalid protocol", most likely because I have Baloo disabled. Either the error message needs to be more clear, or the item should be hidden for disabled Baloo.
Oh good point, I forgot that this won't work if Baloo is disabled. I'll guard it behind an #ifdef, which appears to be the standard way to do this, looking through Dolphin's code.
Since I'm proposing to change a default, the #ifdef will only avoid creating the bookmark on first launch for systems where Baloo is disabled at the distro-level. For users who opt to turn Baloo off themselves, I think it's safe to assume they're technically competent enough to understand the ramifications of that decision. But yes, it would be nice if there was a better error message. With Baloo disabled, I assume your Information panel also doesn't show Tags, right?
Note that this only works if there are no custom places yet (probably not a big deal).
src/filewidgets/kfileplacesmodel.cpp | ||
---|---|---|
110 | Doesn't seem to be defined in KIO. You can use KProtocolInfo::isKnownProtocol(QStringLiteral("tags")) |
Yes, the idea here is to change the default setting for new installs, and this code is only run the first time, before the user has added any custom places.
Thanks for pointing out the #ifdef HAVE_BALOO issue. I'll admit wasn't actually able to test this due to the Frameworks 5.38.0 bump yesterday which caused a few build issues, and I couldn't get all the dependencies to build. I'll make the requested change, and test when I'm able to sort out the build issues, or when Neon issues package updates for version 5.38.0.
I wouldn't assume this: what about the situation when Baloo is compiled in, but disabled by default? The point is that it's not always:
because (for example) the distribution may have compiled it but disabled by default.
The latest change should take care of that concern; I changed the #ifdefto if (KProtocolInfo::isKnownProtocol(QStringLiteral("tags"))), which should cover the case where Baloo was disabled after compilation but before Dolphin was first opened.
https://phabricator.kde.org/D7700 is definitely better. My patch here was just a quick-and-dirty way to get it quickly. We can close mine if that gets committed.
Doesn't make sense; @nicolasfella's new Places Panel section makes more sense to put in once it's ready.