Bug 449126

Summary: Dolphin "All Tags" Panel shows incorrect Tag Display names
Product: [Applications] dolphin Reporter: tagwerk19
Component: panels: foldersAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: RESOLVED FIXED    
Severity: major CC: kfm-devel, meven29, nate, nicolas.fella
Priority: NOR Keywords: regression
Version: 21.12.1   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed In: 5.95
Sentry Crash Report:
Attachments: Hierarchical Tag as listed under "Places" and in "All Tags" panel

Description tagwerk19 2022-01-25 10:39:19 UTC
SUMMARY:

    In Dolphin, if you have tagged files and are using hierarchical tags, Dolphin
    shows you the wrong names when you open "All Tags"

    The is a regression...

STEPS TO REPRODUCE:

    Create a test file
        echo "Hello Penguin" > testfile.txt

    In Dolphin, assign a hierarchical tag
        Parent/Child

    Confirm that baloo has picked it up with:
        balooshow -x testfile.txt

    See that the new top level tag appears under "Places":
        Parent
    It's possible that you need to refresh...

    Click on "All Tags" to explore the top level tags ...

OBSERVED RESULTS

    You get
        Child
    in the Dolphin panel, under the title of "All Tags".

    If you click on this "Unexpected Child" to navigate down, you get
        Child
    again. If you click on this, you get "testfile.txt" listed

    The breadcrumbs above the panel are OK, they show:
        Parent > Child

EXPECTED RESULTS

    You should see "Parent" in the "All Tags" Dolphin panel.

SOFTWARE/OS VERSIONS

    KDE Neon 5.23
    Plasma : 5.23.5
    Frameworks : 5.90.0
    Qt : 5.15.3
    Dolphin : 21.12.1

ADDITIONAL INFORMATION

    This is a regression. I've flagged as major as it breaks navigation in the "tag folders"

    It seems that the Dolphin panel (when you have hierarchical tags) shows the name
    of the "leaf" for a tag "Parent/Child", the panel displays "Child", for
    "Parent/Child/Grandchild", the panel displays "Grandchild".

    This is recent in Neon, with neon-user-2021-12-30.iso it worked.

        KDE Neon 5.23
        Plasma : 5.23.4
        Frameworks : 5.89.0
        Qt : 5.15.3
        Dolphin : 21.12.0

    Whereas neon-user-2022-01-13.iso fails

        KDE Neon 5.23
        Plasma : 5.23.5
        Frameworks : 5.90.0
        Qt : 5.15.3
        Dolphin : 21.12.1

    Maybe related to the fix to Bug 416389?

    There's no problem with the baloo indexing:
        balooshow -x testfile.txt
    shows the expected information
        8242b0000fc01 64513 533547 testfile.txt [/home/test/testfile.txt]
                Mtime: 1643066934 2022-01-25T00:28:54
                Ctime: 1643066950 2022-01-25T00:29:10
                Cached properties:
                        Line Count: 1

        Internal Info
        Terms: Mplain Mtext T5 T8 X20-1 hello penguin
        File Name Terms: Ftestfile Ftxt
        XAttr Terms: TAG-Parent/Child TAchild TAparent
        lineCount: 1

    And CLI searches
        baloosearch tags:Parent
        baloosearch tags:Child
        baloosearch tags:Parent/Child
    return the expected:
        /home/test/testfile.txt
Comment 1 tagwerk19 2022-01-25 15:34:32 UTC
Created attachment 145920 [details]
Hierarchical Tag as listed under "Places" and in "All Tags" panel

Shown as "Parent" under "Places" but "Child" in the "All tags" panel
Comment 2 Méven Car 2022-01-31 11:18:30 UTC
I reproduce it most likely a regression from https://invent.kde.org/frameworks/baloo/-/merge_requests/72
Comment 3 Bug Janitor Service 2022-01-31 17:11:01 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/baloo/-/merge_requests/75
Comment 4 Bug Janitor Service 2022-01-31 17:20:48 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/baloo/-/merge_requests/76
Comment 5 tagwerk19 2022-04-28 05:27:46 UTC
A kind and gentle
    ... Is this stuck and can I do anything?
    enquiry
Comment 6 Méven Car 2022-04-29 10:54:20 UTC
(In reply to tagwerk19 from comment #5)
> A kind and gentle
>     ... Is this stuck and can I do anything?
>     enquiry

I you manage to test the patch and confirm it works, that' would be helpful. But It might be too much to ask of you if you are not technical, since it implies compiling and installing baloo.
It worked when I made it, but on the machine I am using currently tags:/ does not work.
Other than that I need some review or some time to test it again.
Comment 7 tagwerk19 2022-04-30 08:36:12 UTC
(In reply to Méven Car from comment #6)
> ... it implies compiling and installing baloo.
"Following Recipes" is sometimes possible and occasionally even works 8-]

So...

    Installed Neon Developer (in a KVM guest)

    sudo pkcon refresh
    sudo pkcon update
    sudo pkcon install liblmdb-dev

    mkdir baloo-env
    cd baloo-env

    git clone -b bug-449126 https://invent.kde.org/meven/baloo

    cmake baloo

    make -j4

    sudo make install

and reboot and test.

I get some compile warnings but the "original" tests seem to behave. Thanks!

What I'm not sure about is how to cleanly copy/install the patched baloo to the "real world".
Comment 8 Méven Car 2022-04-30 09:00:57 UTC
(In reply to tagwerk19 from comment #7)
> (In reply to Méven Car from comment #6)
> > ... it implies compiling and installing baloo.
> "Following Recipes" is sometimes possible and occasionally even works 8-]
> 
> So...
> 
>     Installed Neon Developer (in a KVM guest)
> 
>     sudo pkcon refresh
>     sudo pkcon update
>     sudo pkcon install liblmdb-dev
> 
>     mkdir baloo-env
>     cd baloo-env
> 
>     git clone -b bug-449126 https://invent.kde.org/meven/baloo
> 
>     cmake baloo
> 
>     make -j4
> 
>     sudo make install
> 
> and reboot and test.
> 
> I get some compile warnings but the "original" tests seem to behave. Thanks!
> 
> What I'm not sure about is how to cleanly copy/install the patched baloo to
> the "real world".

Great to see you can help me test things, thank you for your effort.

You have to replace your cmake command by `cmake -DCMAKE_INSTALL_PREFIX=/usr baloo` and `sudo make install` then logout/login again.

Although since I don't know your distro the CMAKE_INSTALL_PREFIX might be something else in your case, this one is valid at least in debian/(k)ubuntu/neon.
You can confirm if this is right value if `ls -l /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/tags.so` returns a file.
Comment 9 tagwerk19 2022-04-30 09:21:59 UTC
(In reply to Méven Car from comment #8)
>  if `ls -l /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/tags.so` returns a file.
Did the testing in Neon Developer, I'm assuming this will give "fewest surprises"...

Yes, the /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/tags.so is updated, I think I'm happy with the install on the dev system. I'm not sure about whether it is OK to copy this file to other systems (Neon User? Fedora 35?) and test with real world data.
Comment 10 Méven Car 2022-05-12 06:02:11 UTC
(In reply to tagwerk19 from comment #9)
> (In reply to Méven Car from comment #8)
> >  if `ls -l /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/tags.so` returns a file.
> Did the testing in Neon Developer, I'm assuming this will give "fewest
> surprises"...
> 
> Yes, the /usr/lib/x86_64-linux-gnu/qt5/plugins/kf5/kio/tags.so is updated, I
> think I'm happy with the install on the dev system. I'm not sure about
> whether it is OK to copy this file to other systems (Neon User? Fedora 35?)
> and test with real world data.

Only on neon with the same versions for the rest of the system.
Comment 11 tagwerk19 2022-06-02 08:11:56 UTC
(In reply to Méven Car from comment #10)
> (In reply to tagwerk19 from comment #9)
> > ... and test with real world data.
> 
> Only on neon with the same versions for the rest of the system.

OK, rather than copy the compiled code to other systems, I've copied "bits" of my real world data to the dev system. It seems, as far as I can tell, to behave as it should.

I notice the issue has propagated downstream, visible in F35 and F36
Comment 12 Méven Car 2022-06-02 10:06:20 UTC
(In reply to tagwerk19 from comment #11)
> (In reply to Méven Car from comment #10)
> > (In reply to tagwerk19 from comment #9)
> > > ... and test with real world data.
> > 
> > Only on neon with the same versions for the rest of the system.
> 
> OK, rather than copy the compiled code to other systems, I've copied "bits"
> of my real world data to the dev system. It seems, as far as I can tell, to
> behave as it should.

I tested it myself back when I wrote the back and since you confirm it works as expected, I am merging the patch.

Thank you for testing !

> 
> I notice the issue has propagated downstream, visible in F35 and F36

That’s the way with regressions. Next version will fix it.
Comment 13 Méven Car 2022-06-02 10:09:52 UTC
Git commit bfc96abd55a196a028967f9c69c28b1080c304c9 by Méven Car.
Committed on 02/06/2022 at 10:03.
Pushed by meven into branch 'master'.

tag:/ better handle uds name field

Break the loop in stat since the first element is "." or the file.

M  +8    -1    src/kioslaves/tags/kio_tags.cpp

https://invent.kde.org/frameworks/baloo/commit/bfc96abd55a196a028967f9c69c28b1080c304c9
Comment 14 tagwerk19 2022-06-04 07:46:04 UTC
Checked on Neon Unstable:
    Plasma 5.25.80
    Frameworks: 5.95.0
and it behaves as it should - Many thanks!