D22144: Add kio recentlyused:/ to access KActivityStats data

Méven Car noreply at phabricator.kde.org
Fri Aug 23 10:31:04 BST 2019


meven added inline comments.

INLINE COMMENTS

> dfaure wrote in CMakeLists.txt:29
> You should also set LIBRARY_OUTPUT_DIRECTORY, see https://community.kde.org/Guidelines_and_HOWTOs/Making_apps_run_uninstalled

This will be the first ioslave in kio-extras using it...
Some of the ioslave even use the old protocol files...
Might be a followup maintenance Diff...

> dfaure wrote in recentlyused.cpp:91
> I may be missing something, but if you don't really reimplement rewriteUrl, then what's the point of using ForwardingSlaveBase in the first place, instead of just SlaveBase?
> 
> IIRC *all* of ForwardingSlaveBase's code is based on the rewriteUrl idea.

I started my work upon the recentdocument ioslave that used it and ForwardingSlaveBase documentation states "It has been designed to support only local filesystem like ioslaves.. If the resulting ioslave should be a simple proxy, you only need to implement the ForwardingSlaveBase::rewriteUrl() method." makes it sound like that is what I needed.
Using SlaveBase would need a lot more code added also that I don't particularly need to implement here.
But please correct me.

> dfaure wrote in recentlyused.cpp:109
> (hmm, someone should implement operator |= in kactivities-stat, to make such code simpler and possibly faster)

Tried implementing this in D23372 <https://phabricator.kde.org/D23372> but @ivan was not found of it because of induced complexity it entails to work properly.

> dfaure wrote in recentlyused.cpp:256
> Isn't that a problem? Any user of this ioslave might stat() a URL representing a file or directory, coming from this kioslave.
> 
> E.g. if you paste a URL of a subdir from one dolphin window to another, I suspect it will happen then. At least in konqueror it does, maybe dolphin assumes everything is a directory since it can't do much with a file URL....

I implemented the kioslave to allow only stating and listing "/" path on purpose : I could not find a use case for subdirs.
I chose url parameters to pass pararmeters for simplicity albeit it makes it less appealing in UI as you cannot have subpath breaking down your parameters.
Any files or folders appearing in the ioslave keep their true urls.

> dfaure wrote in recentlyused.h:57
> That's ambiguous. Is it a path or a URL?
> 
> A "path that can contain schemes" is an invalid mixture of two different things.
> If it's a path, a '#' will mean an actual '#' in the filename.
> If it's a URL, a '#' in the filename will require encoding as %23, since a '#' in the URL would actually mean a fragment.

It is path currently due to limitation in RecentlyUsed::udsEntryFromResource being able to create valid UDS::Entry only for files.
But it could evolve later to support any url that the sqlite database ~/.local/share/kactivitymanagerd/resources/database stores in its targettedResource column, including ioslave urls, kcm urls, applications desktop files...

REPOSITORY
  R320 KIO Extras

REVISION DETAIL
  https://phabricator.kde.org/D22144

To: meven, ivan, #frameworks, ngraham, dfaure
Cc: elvisangelaccio, kde-frameworks-devel, kfm-devel, aprcela, vmarinescu, fprice, LeGast00n, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190823/89980c6a/attachment.htm>


More information about the kfm-devel mailing list