[KFilePlacesModel] Support pretty baloosearch URLs
ClosedPublic

Authored by broulik on Jul 11 2018, 9:17 AM.

Details

Summary

D14042 moves the logic into the KIO slave

Test Plan

Adjusted test, passes
All "Search For" default entries in Dolphin still work
Kickoff shows pretty search URLs now

Depends on D14042

Diff Detail

Repository
R241 KIO
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
broulik created this revision.Jul 11 2018, 9:17 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJul 11 2018, 9:17 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Jul 11 2018, 9:17 AM
broulik edited the test plan for this revision. (Show Details)
ngraham accepted this revision.Jul 11 2018, 1:03 PM

Tested with a new and existing user. Entries in Kickoff, Dolphin, Gwenview, and the file dialogs all work perfectly, and the subtitles in Kickoff are pretty. Code looks sane.

This revision is now accepted and ready to land.Jul 11 2018, 1:03 PM
hein accepted this revision.Jul 11 2018, 4:07 PM
This revision was automatically updated to reflect the committed changes.

This change broke KFilePlacesViewTest, please update that test as well.

$ bin/kfileplacesviewtest

  • Start testing of KFilePlacesViewTest *****

Config: Using QtTest library 5.11.1, Qt 5.11.1 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 5.3.1 20160301 [gcc-5-branch revision 233849])
PASS : KFilePlacesViewTest::initTestCase()
PASS : KFilePlacesViewTest::testUrlChanged(Today)
PASS : KFilePlacesViewTest::testUrlChanged(Yesterday)
FAIL! : KFilePlacesViewTest::testUrlChanged(Documents) Compared values are not the same

Actual   (args.at(0).toUrl().toString()): "baloosearch:/documents"
Expected (expectedUrl)                  : "baloosearch:?json=%7B%22dayFilter%22: 0, %22monthFilter%22: 0, %22yearFilter%22: 0, %22type%22: [ %22Document%22]%7D"
Loc: [/d/kde/src/5/frameworks/kio/autotests/kfileplacesviewtest.cpp(114)]

FAIL! : KFilePlacesViewTest::testUrlChanged(Images) Compared values are not the same

Actual   (args.at(0).toUrl().toString()): "baloosearch:/images"
Expected (expectedUrl)                  : "baloosearch:?json=%7B%22dayFilter%22: 0, %22monthFilter%22: 0, %22yearFilter%22: 0, %22type%22: [ %22Image%22]%7D"
Loc: [/d/kde/src/5/frameworks/kio/autotests/kfileplacesviewtest.cpp(114)]

FAIL! : KFilePlacesViewTest::testUrlChanged(Audio Files) Compared values are not the same

Actual   (args.at(0).toUrl().toString()): "baloosearch:/audio"
Expected (expectedUrl)                  : "baloosearch:?json=%7B%22dayFilter%22: 0, %22monthFilter%22: 0, %22yearFilter%22: 0, %22type%22: [ %22Audio%22]%7D"
Loc: [/d/kde/src/5/frameworks/kio/autotests/kfileplacesviewtest.cpp(114)]

FAIL! : KFilePlacesViewTest::testUrlChanged(Videos) Compared values are not the same

Actual   (args.at(0).toUrl().toString()): "baloosearch:/videos"
Expected (expectedUrl)                  : "baloosearch:?json=%7B%22dayFilter%22: 0, %22monthFilter%22: 0, %22yearFilter%22: 0, %22type%22: [ %22Video%22]%7D"
Loc: [/d/kde/src/5/frameworks/kio/autotests/kfileplacesviewtest.cpp(114)]

PASS : KFilePlacesViewTest::cleanupTestCase()
Totals: 4 passed, 4 failed, 0 skipped, 0 blacklisted, 891ms

  • Finished testing of KFilePlacesViewTest *****
dhaumann added inline comments.
src/filewidgets/kfileplacesmodel.cpp
137

const auto validSearchPaths = { ... }; Would use an initializer list. This would be likely faster, since it would avoid the QStringList.