Move URL parsing methods from kioslave to query object
ClosedPublic

Authored by iasensio on Oct 5 2019, 11:26 PM.

Details

Summary

This allows for query objects generated from Baloo::Query::fromSearchUrl to use the same URLs parsing as those using the kioslave.
Previously, only query urls with json format were available, while the kioslave could also parse the query keyword and simple type urls.
This was preventing the file type to be updated for places panels' default search urls (e.g. baloosearch://videos)

Test Plan
  • Open dolphin searchbar and activate "More Options"
  • Type baloosearch://images
  • The type 'Images' gets selected

Diff Detail

Repository
R293 Baloo
Branch
extend_query_url
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 18709
Build 18727: arc lint + arc unit
iasensio created this revision.Oct 5 2019, 11:26 PM
Restricted Application added projects: Frameworks, Baloo. Β· View Herald TranscriptOct 5 2019, 11:26 PM
Restricted Application added a subscriber: kde-frameworks-devel. Β· View Herald Transcript
iasensio requested review of this revision.Oct 5 2019, 11:26 PM
iasensio edited the summary of this revision. (Show Details)Oct 6 2019, 8:41 AM

Friday ping πŸ˜ƒ

meven added a reviewer: astippich.
meven accepted this revision.Nov 11 2019, 11:20 AM

Seems good to me.
Tested and works

This revision is now accepted and ready to land.Nov 11 2019, 11:20 AM
bruns added a subscriber: bruns.Nov 11 2019, 3:05 PM
bruns added inline comments.
src/lib/query.cpp
317

dayFilter/monthFilter/yearFilter are pointless, as they just default, but have to be parsed in fromJSON.

329

can be replaced by QStringLiteral("{\"type\":[\"Document\"]}"), dito below.

iasensio updated this revision to Diff 69613.Nov 11 2019, 9:57 PM
iasensio marked 2 inline comments as done.

Simplify helper function

bruns added a subscriber: broulik.Nov 11 2019, 11:30 PM
bruns added inline comments.
src/kioslaves/search/kio_search.cpp
88

@broulik - why endsWith()?

iasensio updated this revision to Diff 69836.Nov 16 2019, 12:24 PM

Remove extra spaces

iasensio added inline comments.Nov 16 2019, 12:26 PM
src/kioslaves/search/kio_search.cpp
88

should I just change the comparisons to path == ..., just like the /documents one?

@bruns, is this good to go now?

ngraham accepted this revision.Dec 12 2019, 8:57 PM

Let's do this unless @bruns objects soon. :)

bruns added inline comments.Dec 13 2019, 1:12 AM
src/lib/query.cpp
342

just return Query::fromJSON(jsonString.toUtf8());

343

remove the else

345

just return q;

346

remove else

349

just return Query::fromJSON(jsonString.toUtf8());

bruns requested changes to this revision.Dec 13 2019, 1:13 AM

just nitpicks ...

This revision now requires changes to proceed.Dec 13 2019, 1:13 AM
iasensio updated this revision to Diff 71523.Dec 14 2019, 3:15 PM
iasensio marked 5 inline comments as done.
  • Use return statements
bruns accepted this revision.Dec 14 2019, 3:54 PM
This revision is now accepted and ready to land.Dec 14 2019, 3:54 PM
This revision was automatically updated to reflect the committed changes.