2009/9/14 David Faure : > IIRC Solid has a way to find the device from the device name like /dev/sdb1, > so instead of a kioslave-specific hack, how about using /dev/sdb1 as the path > for which to show the popupmenu? "All" we need to do is to show mount/unmount > for such paths, and that seems easy to do: just modify > KDesktopFileActions::builtinServices (in kio) so that it calls > KMountPoint::currentMountPoints().findByDevice(_url.path()) when _url is a > device path rather than a .desktop file. Something like the attached patch > (untested). > > Ah, but we can only recognize /dev/sdb1 if it's already mounted; otherwise > (if it's not mounted and it's not in fstab), how can we find out it's a > mountable device? Via Solid maybe? Kevin? ;) > + if (KDesktopFile::isDesktopFile(path)) { It only checks if file name matches *.desktop. And KDE generates desktop files without .desktop in name. > + if (mp) { > + return path; > + } We expect deviceForUrl(...) to return device (/dev/...) not path (/home/x/Desktop/harddrive). Moreover KDesktopFileActions::builtinServices is never called, because of condition in kfileitemactions.cpp: > if (isSingleLocal && d->m_props.mimeType() == "application/x-desktop") { // .desktop file I understand your patch was not supposed to work, was not testes. Just pointed that to explain why I made changes in my version. I'll clean my patch and attach it soon. One question: It's very important IMO to backport this (un)mount work to KDE 4.3. This KDE is used by openSUSE 11.2 (and KUbuntu 9.10 I guess) so hopefully they will still able to update it and provide working (un)mount for they distros. Do you agree on that? Do I have permission to backport upcoming patches to 4.3? -- RafaƂ