[Kde-hardware-devel] How to determine what drive an Optical Disc is in
Kevin Ottens
ervin at kde.org
Thu Jan 31 09:22:05 CET 2008
Le mercredi 30 janvier 2008, Chris Gow a écrit :
> If I have a Solid::OpticalDisc object, how do I find out what device/drive
> it is mounted in?
>
> Solid::Device *d = new Solid::Device(someValidDeviceID);
> Solid::OpticalDisc *opticalDisc = d->as<Solid::OpticalDisc>();
>
> QString mountedAt = /* eg. /dev/cdrom or some such */
[I assume you meant "/media/cdrom", not "/dev/cdrom" which is not a
mountpoint]
You have to use the StorageAccess interface on the same device object, which
would give:
Solid::StorageAccess *access = d->as<Solid::StorageAccess>();
QString mountedAt = access->filePath();
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: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20080131/47f8d8ed/attachment.pgp
More information about the Kde-hardware-devel
mailing list