Bug 461006 - krunner Recent Files plugin only searches for filenames starting with a given pattern
Summary: krunner Recent Files plugin only searches for filenames starting with a given...
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: 5.26.1
Platform: Neon Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2022-10-26 07:05 UTC by Om
Modified: 2022-11-07 13:46 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27


Attachments
(a) The recent file 'some_recent_file.txt' being listed when the search string is `some`, whereas (b) it is not when the search string is `recent`. (29.70 KB, image/png)
2022-10-26 07:05 UTC, Om
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Om 2022-10-26 07:05:25 UTC
Created attachment 153211 [details]
(a) The recent file 'some_recent_file.txt' being listed when the search string is `some`, whereas (b) it is not when the search string is `recent`.

SUMMARY
When searching for a recently modified file through krunner, it can be observed the file is shown only when the search pattern matches from the start of the filename and nowhere else.

STEPS TO REPRODUCE
1. Create a new text file '~/some_recent_file.txt', write something in it, save it, and close it.
2. Try to find the file using the pattern `some` in krunner.
3. Next, try to find the file again using the patterns `recent` or `file`.

OBSERVED RESULT
The modified file is shown in step 2 (see attached figure (a)) but not in step 3 (see attached figure (b)).

EXPECTED RESULT
It would be helpful if the modified file is shown under both the above-mentioned circumstances.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Plasma
KDE Plasma Version: 5.26.1
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.6
Comment 1 Bug Janitor Service 2022-10-26 14:16:57 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2273
Comment 2 Natalie Clarius 2022-10-27 19:12:13 UTC
Git commit 11e14085889196266b114456ee5174a729fc3e8f by Natalie Clarius.
Committed on 27/10/2022 at 18:13.
Pushed by ngraham into branch 'master'.

runners/recentdocuments: match term anywhere in file name

M  +1    -1    runners/recentdocuments/recentdocuments.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/11e14085889196266b114456ee5174a729fc3e8f
Comment 3 Bug Janitor Service 2022-11-07 06:53:31 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2310
Comment 4 Alexander Lohnau 2022-11-07 13:46:56 UTC
Git commit 8fb57f7d6baa6f92d1af537ac1afde43f89d852c by Alexander Lohnau.
Committed on 07/11/2022 at 06:48.
Pushed by alex into branch 'master'.

runners/recentdocuments: Only match files from kactivities and not other entries

This would for example cause `application:<some file>.desktop` entires to show up.
To avoid this, we have to ensure that our query starts with a /. After that we allow any folder name
and then any string that contains the given term.
Related: bug 461531

M  +1    -1    runners/recentdocuments/recentdocuments.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/8fb57f7d6baa6f92d1af537ac1afde43f89d852c