KIO::is_manually_mounted() and device UUIDs

Kevin Ottens ervin at kde.org
Thu Apr 26 07:12:20 BST 2007


Le jeudi 26 avril 2007 01:08, David Faure a écrit :
> KIO::is_manually_mounted() greps /etc/fstab for the "noauto" option, for a
> given device. But this doesn't work anymore, now that kubuntu converted
> /etc/fstab to use UUIDs instead of device names:
>
> # /dev/sda7 -- converted during upgrade to edgy
> UUID=2c31247e-d3a0-11da-bd28-314ffa00bcaa /home ext3 defaults 0 2
>
> I tried using KMountPoint::currentMountPoints with
> KMountPoint::NeedMountOptions but this doesn't help, because /etc/mtab
> keeps the mount options but not "noauto" (since it doesn't care about it).
>
> Any other ideas? How would I go about finding the uuid of a given device?

What about using Solid::Volume::uuid()?

Actually if you have an uuid you can get the device which match it using a 
predicate like: "Volume.uuid == 'uuid'", it'll get you the only device which 
match it, then calling d.as<Block>()->device() will get you the device node 
for instance.

> I know, this all sounds hackish, but this is the best way to know if we
> should keep a watch (with kdirwatch) on a given directory being listed by
> kdirlister; manually mounted directories (like CDROMs or USB keys) cannot
> be unmounted if FAM is watching a given directory (#37780).

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070426/7335cb96/attachment.sig>


More information about the kde-core-devel mailing list