D22144: Add kio recentlyused:/ to access KActivityStats data

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

D22144: Add kio recentlyused:/ to access KActivityStats data

Nathaniel Graham
View Revision
meven added inline comments.

INLINE COMMENTS
View Inlinedfaure 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...


View Inlinedfaure 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.


View Inlinedfaure 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 but @ivan was not found of it because of induced complexity it entails to work properly.


View Inlinedfaure 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.


View Inlinedfaure 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


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