Bug 433990 - Dolphin does not trim leading/trailing spaces from new tags
Summary: Dolphin does not trim leading/trailing spaces from new tags
Status: REPORTED
Alias: None
Product: baloo-widgets
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 20.12.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Stefan Brüns
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-05 09:06 UTC by tagwerk19
Modified: 2021-05-22 12:55 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Comparision of Assign Tags, Information Panel and Tag Folder views (81.08 KB, image/png)
2021-05-22 07:23 UTC, tagwerk19
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tagwerk19 2021-03-05 09:06:40 UTC
SUMMARY:

    Dolphin can create tags/tag components with leading/trailing spaces,
    these are shown as distinct in the tag list 

STEPS TO REPRODUCE:

    Create a test file and attach tags "mytag", " mytag", "mytag ",
    " mytag " and "parenttag / mytag" (using "Assign Tags" from context menu)

    Check the file with "getfattr -d ..."

OBSERVED RESULTS

    # file: testfile.jpg
    user.xdg.tags="mytag,mytag , mytag, mytag ,parenttag / mytag"

EXPECTED RESULTS

    Leading and trailing spaces should be trimmed from tag components
    before being saved

SOFTWARE/OS VERSIONS

    Neon Testing

    Dolphin : 20.12.3
    Plasma : 5.21.2
    Frameworks : 5.80.0
    Qt : 5.15.2 

ADDITIONAL INFORMATION

    Works better in the information panel "Tags" dialog but that still
    stumbles on tag components, as when creating "parenttag / mytag"

    (I see the discussion for filenames in bug 383376. Gut feeling is that
    if you really want a leading/trailing space, you should explicitly
    quote them. That's probably a separate discussion though)
Comment 1 tagwerk19 2021-05-22 07:23:24 UTC
Created attachment 138664 [details]
Comparision of Assign Tags, Information Panel and Tag Folder views

There's a similar behaviour with leading or trailing slashes on tags...

STEPS TO REPRODUCE

    Make sure Baloo is running in order to see the tag folders under "Places"

    Create a testfile and create, with "Assign Tags", the tags "/tag"
    and "tag/". Confirm the tags have been written with getfattr:

            getfattr -d testfile.txt

            # file: testfile.txt
            user.xdg.tags="/tag,tag/"

OBSERVED RESULTS

    Go back to the file with "Assign Tags" and see what it shows

        * /tag
          tag
        * tag/

    Compare the info to that displayed in the Information Panel and listed
    under "Places" (see attachment...)

EXPECTED RESULTS

    "Assign Tags", the Information Panel and the Tag Folders under
    "Places" should be consistent.

    Maybe "Assign Tags" should drop leading and trailing slashes as
    typed in, should cope with existing leading/trailing slashes when
    it meets them. 

ADDITIONAL INFORMATION

    The information panel doesn't get it quite right either...