This will expose KFilePlacesModel as KIO slave.
With it you can place e.g. a places FolderView in your panel for quick access to your stuff.
BUG: 377375
This will expose KFilePlacesModel as KIO slave.
With it you can place e.g. a places FolderView in your panel for quick access to your stuff.
BUG: 377375
Lists my places, navigating into both local and remove locations works fine. Place icons are taken into account and hidden places are added as hidden files.
It doesn't signal updates when places are added/removed from/to the model as I didn't find signals to notify changes when I had a quick glance at KIO stuff.
Also, a FolderView pointing at places:/ will show the generic folder icon as well as "places:/" title (for the latter this is expected as it uses QUrl fileName, maybe needs to also use the root item's display text somehow) but the icon should be correct at least). Adding places:/ as a places in Dolphin actually uses the correct icon.
It was a first attempt to gather feedback. Additional features it could provide is removing places (on the other hand it might introduce ambiguity if deleting stuff in places:/ just removes the link from places whereas in ~ it will be destructive) and adding them (if you drag a folder into it e.g.)
Lint Skipped |
Unit Tests Skipped |
Nice!
But I don't see anything plasma-specific in this slave. It would be better to put it in kio or kio-extras, imho.
It would be better to put it in kio or kio-extras, imho.
Fine with me. I just used the kios in plasma-workspace as a base, so I put them here to have something to work with first :)
"I didn't find signals to notify changes" --> you mean how to tell apps that something changed in a given protocol? That's what KDirNotify is for, but you can't do the monitoring from a short-lived slave, you need something that stays alive for the whole session, and that's what a kded module can be used for.
IMHO this is for plasma or kio-extras, not kio, at least as long as it's not required by anything in kio itself.
See DesktopNotifier in the desktop:/ slave codebase for an example of a kded module for this purpose.
I worked on that stuff (the internal dbus stuff) once to make desktop:/ in KDirModel not remove+insert but just dataChange when a file is renamed, so FV wouldn't lose the icon position :)
Another question I had was how could I add a new place when I drag a folder in it? I tried implementing copy() and symlink() but that is only called when stuff happens within my protocol and for mkdir() I only know what folder to create not why it will be created.
I managed to implement renaming and removing of places but you could have two places with the same text but having to files with the same name probably isn't a good idea and the potentially ambiguous URLs are all I get in rename().
Of course we could also just have places:/ read-only and call it a day.
Hmm it would be really nice if we could get the title to read "Places" somehow, yeah.