Support special URLs for finding files of a certain type
ClosedPublic

Authored by broulik on Wed, Jul 11, 9:16 AM.

Details

Summary

This moves the URL rewriting logic to the KIO slave so the client just sees a pretty baloosearch:/images URL and the rewriting to a JSON query happens inside the KIO

Test Plan

Mostly copy paste from KFilePlacesModel

  • Opened baloosearch:/images and got pictures

(Could probably use Query class directly instead of going through JSON but it was the simplest way to move this code over)

Diff Detail

Repository
R293 Baloo
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.Wed, Jul 11, 9:16 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptWed, Jul 11, 9:16 AM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
ngraham accepted this revision.Wed, Jul 11, 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.Wed, Jul 11, 1:03 PM
hein added a comment.Wed, Jul 11, 4:09 PM

Does it make sense to name the queries after XDG_USER_DIRS, so e.g. pictures instead of images?

https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

In D14042#290555, @hein wrote:

Does it make sense to name the queries after XDG_USER_DIRS, so e.g. pictures instead of images?

https://www.freedesktop.org/wiki/Software/xdg-user-dirs/

That might introduce the potential for user confusion, for people who add the XDG dirs to their Places panels (or if we ever did that by default), because then there would be multiple entries in different sections with the same text.

This revision was automatically updated to reflect the committed changes.