Bug 474053

Summary: Erroneous "no results" when searching inside a dir containing in the name the substring: [#whatever]
Product: [Applications] dolphin Reporter: nulll <luca.battarra>
Component: searchAssignee: Dolphin Bug Assignee <dolphin-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: kfm-devel, tagwerk19
Priority: NOR    
Version: 21.12.3   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description nulll 2023-09-02 10:44:21 UTC
SUMMARY
Search inside a directory containing 
```
[#whatever]
```
seems broken

STEPS TO REPRODUCE
1. create a dir called:  [#ouch] test
2. inside create some files with various extensions
3. activate search mode
4. filter by File name
6. whatever extension you type, no search result appears

OBSERVED RESULT
- whatever extension you type, no search result appears
- the breadcrumb component fails too

https://drive.google.com/file/d/1uX7iADE_etexJBNETLV2HzpFj5hMiDXb/view

EXPECTED RESULT
search results should appear

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kubuntu 22.04
KDE Plasma Version: 5.24.7
KDE Frameworks Version: 2.92.0
Qt Version: 5.19.3
Comment 1 tagwerk19 2023-09-04 20:12:31 UTC
If I have a test folder and index it with baloo, then I can index the files and find them with the command line tools:

    ~/Testdir$ echo "Hello Penguin" > test.txt
    ~/Testdir$ cp test.txt '#whatever test.txt'

    ~/Testdir$ mkdir '#whatever folder'
    ~/Testdir$ cp test.txt '#whatever folder'

    ~/Testdir$ baloosearch -i Penguin
    140eeb0000fc01 /home/test/Testdir/#whatever folder/test.txt
    1406240000fc01 /home/test/Testdir/#whatever test.txt
    140e7f0000fc01 /home/test/Testdir/test.txt

Similarly Dolphin searches work (provided it is querying the baloo index)

However, if I disable baloo, Dolphin falls back on its internal "There and Then" search and the search fails with an "Invalid Protocol" banner message

The culprit seems to be the "#" in the filename.

Tested on Neon Unstable
    Plasma: 5.27.80
    Frameworks: 5.240.0
    Qt: 6.6