KIO: deprecate KDiskFreeSpaceInfo in favour of FileSystemFreeSpaceJob
Open, Needs TriagePublic

dfaure created this task.Mar 27 2021, 4:12 PM
meven added a subscriber: meven.Mar 27 2021, 4:13 PM

also available in Qt we now have QStorageInfo

Using the job is preferred (where the KIO dependency can be kept) because it won't block.

kio_trash can probably just exec() the job, a blocking call is fine there.

KDiskFreeSpaceInfo is used in KPropertiesDialog's KDevicePropsPlugin, which I think is/was used for device .desktop files ("the link to device" in "Create New" menu?), but that menu action hasn't been installed/disabled for some time IIRC; now the question is should this be ported? or should the KDevicePropsPlugin be removed?

KDiskFreeSpaceInfo is used in KPropertiesDialog's KDevicePropsPlugin, which I think is/was used for device .desktop files ("the link to device" in "Create New" menu?), but that menu action hasn't been installed/disabled for some time IIRC; now the question is should this be ported? or should the KDevicePropsPlugin be removed?

That code is still around and I remember seeing it in action (because I was investigating stuff, not because I had a use case for it)

https://invent.kde.org/frameworks/kio/-/blob/master/src/filewidgets/knewfilemenu.cpp#L1395

Indeed; I did more research and found the diff that had more info: https://phabricator.kde.org/D6446

basically the relevant .desktop file hasn't been installed in a long time.

It's probably time to remove support for Type=Device desktop files. People just don't mount devices that way anymore.
In the very old days, this was the way to mount a CDROM or floppy. But those got replaced with USB devices, which magically show up in plasma.
And then this means removing KDevicePropsPlugin indeed.

IIRC (since it's been some time), even CD devices would be handled by UDisks, so it would show up in the Places panel and device notifier in the system tray; I don't know how floppy drives would be handled, the last time I used a floppy disk was about 13 years ago.

ahmadsamir added a comment.EditedApr 16 2021, 12:39 PM

Porting KIO from KDiskFreeSpaceInfo to QStorageInfo https://invent.kde.org/frameworks/kio/-/merge_requests/408

Removing KDevicePropsPlugin from KPropertiesDialog: https://invent.kde.org/frameworks/kio/-/merge_requests/409

ahmadsamir moved this task from Backlog to In Progress on the KF6 board.Apr 17 2021, 12:30 PM
meven added a comment.Oct 18 2021, 9:20 AM

https://lxr.kde.org/ident?v=stable-kf5-qt5&_i=KDiskFreeSpaceInfo&_remember=1 is a lot thinner now, no KIO or plasma-workspace apart from kdiskfreespaceinfo itself thanks to @ahmadsamir

A few aps uses KDiskFreeSpaceInfo: k3b krusader, smb4k, kup, kwooty, kdenlive, audex and liquidshell.

The rest is KDE4 times libs.

I would propose to deprecate KDiskFreeSpaceInfo now (https://invent.kde.org/frameworks/kio/-/merge_requests/381/diffs)

nicolasfella moved this task from In Progress to Done on the KF6 board.Apr 28 2022, 11:49 PM