Bug 461424

Summary: Add the option to search on the default browser what the user typed if krunner does not have any result
Product: [Plasma] krunner Reporter: Etienne <etienne.coriou>
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: alexander.lohnau, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 5.26.2   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Etienne 2022-11-04 14:01:30 UTC
SUMMARY
It could be a nice addition to send the krunner request to the default web browser if krunner does not have an answer or if the user wants to have more details on what he searched. It would make krunner more polyvaent (for example if the user searched for a website in his history but none was found).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: kernel 6.0.6-arch1-1 (x64)
KDE Plasma Version: 5.26.2
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
Comment 1 Nate Graham 2022-11-04 18:25:46 UTC
It really depends on what you were searching for. For example if you were searching for a local file that wasn't found, then doing a web search is definitely not going to he helpful, and would leak your personal data.

For that reason we couldn't ever make this an automatic behavior; instead if no results are found, we could add a synthetic search result that says, "Search for [search query] on the web". I'm unsure how generically useful this would actually be, though.

What do you think, Alexander and Natalie?
Comment 2 Natalie Clarius 2022-11-04 22:21:43 UTC
I think making use of the existing default search engine setting (where is this actually used anyway?) in the web shortcuts runner and adding a "Search <default engine> for <query>" result that matches any query but with low priority would be useful and should be possible to do.
Comment 3 Bug Janitor Service 2022-11-06 21:24:37 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2307
Comment 4 Bug Janitor Service 2022-11-07 07:21:21 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2311
Comment 5 Nate Graham 2022-11-30 15:48:20 UTC
Git commit 9cc4255347ed021f4bf30088c34570e4bf71735f by Nate Graham, on behalf of Alexander Lohnau.
Committed on 30/11/2022 at 15:09.
Pushed by ngraham into branch 'master'.

runners/webshortcuts: Provide result for default provider if no other results exist

By connecting to the queryFinished signal, we know when all other runners are done with matching.
After that we can check if there are any matches and if not add a match for the default provider.

This way we have the advantage of only showing a result when it is relevant.
For example, when we search for apps and get results, the default search engine result would not be needed.

M  +18   -0    runners/webshortcuts/webshortcutrunner.cpp
M  +3    -0    runners/webshortcuts/webshortcutrunner.h

https://invent.kde.org/plasma/plasma-workspace/commit/9cc4255347ed021f4bf30088c34570e4bf71735f