meven added a comment.
In D24773#554409 <https://phabricator.kde.org/D24773#554409>, @dfaure wrote: > You can do whatever you want in the GUI -- I'll happily step out of that part of the discussion --, as long as you don't abuse UDS_SIZE for what it was not meant for, thus creating an ambiguous meaning for it. > > My suggestion would be to add a UDS_RECURSIVE_SIZE instead. > The problem with that, however, is that the kioslave can't know if the application actually wants the information. So in most cases we would be wasting a lot of time for nothing -- even here it's not fully for free. Some ioslave could provide it by default in some situation like for kio_trash, this make sense for /. > One solution would be to use the "details" metadata for this. > > - 0 (as set by DeleteJob) means bare minimum (filename and type). > - 1 isn't used anymore, but it adds uid, gid, atime, mtime, btime > - 2 is the default, which is the above plus ACL data > - 3 requests in addition the device and inode number (from kio_file), so that DirectorySizeJob can check for hardlinks > - we could add that 4 means "I want UDS_RECURSIVE_SIZE too". Good idea, could be a base to fix https://bugs.kde.org/show_bug.cgi?id=158090 later. This `KIO::stat` details parameter begs to be a bitmask... I am thinking about adding a KF6 TODO about this. > I don't know if this will be useful in any other kioslave, but at least here it would allow skipping this stuff when not needed. > > Sample code, like in kio_file and kio_ftp: > > const QString sDetails = metaData(QLatin1String("details")); > const int details = sDetails.isEmpty() ? 2 : sDetails.toInt(); > All dependent of the implementations and the users. But for sure UDS_RECURSIVE_SIZE cannot be a default. About https://bugs.kde.org/show_bug.cgi?id=158090 I would imagine something where the job recurse at most N levels, or M number of directory before stopping with N = 4 and M = 300. Returning incomplete results, but enough to give good information in most usercases. REPOSITORY R241 KIO REVISION DETAIL https://phabricator.kde.org/D24773 To: meven, #frameworks, ngraham, elvisangelaccio, dfaure Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns