Mountable devices support in KDE

Kevin Ottens ervin at kde.org
Tue Sep 15 10:46:08 BST 2009


On Monday 14 September 2009 17:35:34 David Faure wrote:
> 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? ;)

Hm, something like:
QList<Solid::Device> list = Solid::Device::listFromQuery(
    "[ IS StorageAccess and Block.device == '/dev/sdb1' ]");

if (list.isEmpty()) {
    // Whoops, /dev/sdb1 isn't available, or is not something we can mount
} else {
    // Cool! We found the thing to mount!
}

Would work I think.

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: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090915/6e11f9c0/attachment.sig>


More information about the kde-core-devel mailing list