Skip to content

runners/webshortcuts: search with default provider when no keyword matches

Add a match to search with the configured default search engine (provided that one is set) for any query that's not already a web search keyword.

It fires without any further restrictions on the syntax, but with a low type and relevance, so it will only rise to the top if there are no more relevant results from other plugins.

The free query match replaces the old bang syntax. I don't see the benefit it provided over typing the keyword with the regular delimiter, or am I missing something?

Also, unlike previously, it is being checked whether the user actually has a default search engine set. This is done by reading the default keyword from the kuriikwsfilter config file. It would be more elegant to get it from the filter data, but as far as I can tell it's not exposed?

Since it would otherwise have overcomplicated the code, the URI filter request is now always done when running the result; as far as I see, the only case where the old version would have avoided one additional iteration is with a single letter as the search term, which is not a likely scenario anyway, or is there some other performance cut I'm overlooking?

The filter request simply emulates a web keyword search by prepending the default keyword and delimiter to the query term. If that's bad somehow, it would also be possible to use KUriFilter::NormalTextFilter with the raw query instead.

websearch

BUG: 461424

Merge request reports

Loading