Bug 491393 - Add Tag button in the Information panel (F11) adds slash to added tags which causes issues
Summary: Add Tag button in the Information panel (F11) adds slash to added tags which ...
Status: RESOLVED DUPLICATE of bug 488588
Alias: None
Product: dolphin
Classification: Applications
Component: panels: information (show other bugs)
Version: 24.08.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-07 14:41 UTC by player_005
Modified: 2024-10-10 18:50 UTC (History)
5 users (show)

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


Attachments
a python script to automatically fix file tags with an extra slash ("/") (1.03 KB, text/x-python)
2024-08-10 21:30 UTC, player_005
Details
kedittagsdialog.cpp Baloo-widgets.patch (391 bytes, text/plain)
2024-10-10 18:40 UTC, reports_go_brrr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description player_005 2024-08-07 14:41:05 UTC
SUMMARY
When adding tags to one or more files using the button in the information panel (unlike when using right click > assign tags), a / (slash) will be added to the tag name.
In addition to adding a character that's not supposed to be there to the tag name, this causes some issues such as the file not appearing when browsing files by tag.

STEPS TO REPRODUCE
1. use right click > assign tags to add a new tag to a file or directory
2. select one or more files and add the same tag to another file using the info panel
3. You might have to restart dolphin in order for the tag to show in the "tags" section

OBSERVED RESULT
When enabling "show additional information" > "tags" (or using the "assign tags" right click menu to inspect the tags), You will see that on the first file, the tag shows correctly, whereas on the second file, a slash is added to the tag.
When selecting the tag in the tags section on the "places panel" in order to browse all files with the tag, You will find only files that had the tag added using the right click menu show, whereas the files you added the tag to by using the information panel won't show.
This is pretty bad since one of the main reasons to use tags (at least for me) is to later browse all files with that tag.

EXPECTED RESULT
The tag gets added correctly, and the file appears when browsing the tag.

SOFTWARE/OS VERSIONS
Operating System: Aurora-DX 40
KDE Plasma Version: 6.1.3
KDE Frameworks Version: 6.4.0
Qt Version: 6.7.2
Kernel Version: 6.9.7-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i3-10100 CPU @ 3.60GHz
Memory: 15.5 GiB of RAM
Graphics Processor: AMD Radeon RX 6600 XT

ADDITIONAL INFORMATION
-
Comment 1 player_005 2024-08-10 21:30:48 UTC
Created attachment 172494 [details]
a python script to automatically fix file tags with an extra slash ("/")

For anyone else coming across this issue who wants to use the information panel for tagging but also wants to be able to browse tags properly, this is my python script that I use to recursively fix all file tags starting from a given directory (requires xattr which can be installed from pypi).
Comment 2 Kody 2024-09-29 18:16:07 UTC
I'm not super familiar with the source code, nor do I know how to build a custom baloo-widgets and have that work with my Dolphin instance, so I might be totally wrong with this but in baloo-widgets/src/kedittagsdialog.cpp line 148 (https://github.com/KDE/baloo-widgets/blob/master/src/kedittagsdialog.cpp#L148), I wonder if the leading "QLatin1Char('/') +" is the reason it's happening.
Comment 3 player_005 2024-09-30 12:57:36 UTC
(In reply to Kody from comment #2)
> I'm not super familiar with the source code, nor do I know how to build a
> custom baloo-widgets and have that work with my Dolphin instance, so I might
> be totally wrong with this but in baloo-widgets/src/kedittagsdialog.cpp line
> 148
> (https://github.com/KDE/baloo-widgets/blob/master/src/kedittagsdialog.
> cpp#L148), I wonder if the leading "QLatin1Char('/') +" is the reason it's
> happening.

Thank You! That looks like it really could be the relevant code, especially considering it was added 8 months ago, and I remember this is around the time this bug started to happen.
I am, unfortunately, not at all familiar with the codebase either, but maybe someone else with more knowledge will be able to confirm this is the cause and pr a solution.
Comment 4 tagwerk19 2024-10-01 13:39:28 UTC
*** Bug 493862 has been marked as a duplicate of this bug. ***
Comment 5 tagwerk19 2024-10-01 13:54:03 UTC
(In reply to tagwerk19 from comment #4)
> *** Bug 493862 has been marked as a duplicate of this bug. ***
Upon reflection there are two bugs here...

... One is the way that Dolphin adds the leading slash (when it probably should not)
... The second is that Dolphin cannot cope with existing leading slashes (so it stumbles on tags:/mytag)
Comment 6 tagwerk19 2024-10-01 18:09:23 UTC
(In reply to tagwerk19 from comment #5)
> ... Dolphin adds the leading slash (when it probably should not)
Marking confirmed....
Comment 7 Canoe 2024-10-02 18:53:46 UTC
Confirmed in Dolphin 24.08.1 on : 
EndeavourOS 
KDE Plasma Version: 6.1.5
KDE Frameworks Version: 6.6.0
Qt Version: 6.7.3
Kernel Version: 6.11.1-arch1-1 (64-bit)

(Tagging files in Gwenview works without issue).
Comment 8 reports_go_brrr 2024-10-05 19:18:00 UTC
Fix me if there is more ancient bug report than #488588

*** This bug has been marked as a duplicate of bug 488588 ***
Comment 9 reports_go_brrr 2024-10-10 18:40:58 UTC
Created attachment 174643 [details]
kedittagsdialog.cpp Baloo-widgets.patch

Patch I made fixed my problem. Implement it at latest git of Baloo-widgets.