Bug 405777 - Assigning Tag to a file on the desktop creates a new Tag
Summary: Assigning Tag to a file on the desktop creates a new Tag
Status: RESOLVED FIXED
Alias: None
Product: baloo-widgets
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 19.04.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: baloo-bugs-null
URL:
Keywords:
: 406291 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-03-23 09:46 UTC by Alex Nemeth
Modified: 2019-04-28 22:22 UTC (History)
4 users (show)

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


Attachments
New tags are created (9.67 KB, image/png)
2019-03-23 09:46 UTC, Alex Nemeth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Nemeth 2019-03-23 09:46:19 UTC
Created attachment 118983 [details]
New tags are created

SUMMARY
When I assign a Tag to a file that is located on the desktop a new Tag is created without the first letter of the Tag.
For example if I assign a file to the Tag "Test" a new Tag called "est" gets created and the file is assigned to that tag.
It only happens when I assign a Tag on the desktop. If I assign a Tag to a file in the desktop folder from Dolphin it works as expected

STEPS TO REPRODUCE
1. Right click on a file on the desktop
2. Assign Tags
3. click on an existing Tag (for example "Test")

OBSERVED RESULT
A new Tag is created with the first letter cut off

EXPECTED RESULT
Do not create a new Tag

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Developer edition
(available in About System)
KDE Plasma Version: 5.15.80
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.0

ADDITIONAL INFORMATION
See the attached image for clarifications.
Comment 1 Patrick Silva 2019-04-26 14:52:18 UTC
I can confirm. Same behavior occurs when I create a second tag and immediately assign it to another file via Dolphin.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.3
Comment 2 Stefan Brüns 2019-04-26 20:46:52 UTC
*** Bug 406291 has been marked as a duplicate of this bug. ***
Comment 3 Stefan Brüns 2019-04-26 20:48:25 UTC
From the source code:

                    // HACK the first character of QAction::text is '&'
                    newTags.append(action->text().remove(0,1));
                    m_metaData->setTags(newTags);
Comment 4 Stefan Brüns 2019-04-28 00:03:00 UTC
Git commit eb084799ad5bfc6fae4620c6516c7cc2d6775658 by Stefan Brüns.
Committed on 28/04/2019 at 00:02.
Pushed by bruns into branch 'master'.

[TagsFileItemAction] Fix bad truncation of tag name

Summary:
Instead of reconstructing the tag name from the QAction text, just
capture the tag name. The action is not required in the capture, as the
`checked` state is emitted as a signal parameter.

Test Plan: Add tag via context menu

Reviewers: #baloo, #dolphin, nicolasfella, ngraham, elvisangelaccio

Reviewed By: nicolasfella

Subscribers: lbeltrame

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D20855

M  +6    -10   src/tagsfileitemactionplugin/tagsfileitemaction.cpp

https://commits.kde.org/baloo-widgets/eb084799ad5bfc6fae4620c6516c7cc2d6775658
Comment 5 Stefan Brüns 2019-04-28 11:22:37 UTC
Git commit 0bce0c4eda2b9cc7bf1e3490693851e7d0ff8efe by Stefan Brüns.
Committed on 28/04/2019 at 11:10.
Pushed by bruns into branch 'Applications/19.04'.

[TagsFileItemAction] Fix bad truncation of tag name

Summary:
Instead of reconstructing the tag name from the QAction text, just
capture the tag name. The action is not required in the capture, as the
`checked` state is emitted as a signal parameter.

Test Plan: Add tag via context menu

Reviewers: #baloo, #dolphin, nicolasfella, ngraham, elvisangelaccio

Reviewed By: nicolasfella

Subscribers: lbeltrame

Tags: #baloo

Differential Revision: https://phabricator.kde.org/D20855

M  +6    -10   src/tagsfileitemactionplugin/tagsfileitemaction.cpp

https://commits.kde.org/baloo-widgets/0bce0c4eda2b9cc7bf1e3490693851e7d0ff8efe