<br><br><div class="gmail_quote">On Tue, Jun 10, 2008 at 4:34 PM, David Boosalis <<a href="mailto:david.boosalis@gmail.com">david.boosalis@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi All.<br><br>My first time use of Solid as I want to capture in my application when a USB Memory stick gets inserted into the computer. I have no problem getting the event, my question is how do I go from a Solid Class to a File Path, so I can open up a file dialog on it.<br>
<br>Here is my slot thus far:<br><br>void MyApp::slotSolidDeviceChanged(const QString &str)<br>{<br> qDebug() << "Device changed " << str;<br> QString filePath;<br> Solid::Device device(str);<br>
Solid::DeviceInterface *deviceInterface;<br> Solid::StorageAccess *accessStorage;<br> Solid::StorageVolume *volumeStorage;<br> if (device.isValid())<br> {<br> if (<a href="http://device.is" target="_blank">device.is</a><Solid::StorageAccess>()) {<br>
deviceInterface = device.asDeviceInterface(Solid::DeviceInterface::StorageDrive);<br><br> usbStick = <a href="http://device.as" target="_blank">device.as</a><Solid::StorageDrive>();<br><br> volumeStorage = <a href="http://device.as" target="_blank">device.as</a><Solid::StorageVolume>();<br>
accessStorage = <a href="http://device.as" target="_blank">device.as</a><Solid::StorageAccess>();<br> qDebug() << "file path = " << accessStorage->filePath(); // produces NULL code<br>
qDebug() << "uuid = " << volumeStorage->uuid();<br>
qDebug() << "Volumne Label = " << volumeStorage->label(); <br> }<br><br></blockquote></div><br>Dave,<br>Are you sure the drive is mounted? If not, then filePath() should return an empty string. Make to use StorageAccess::setup. This will mount the drive and, if successful, you should be able to get a file path. Also, I've included kde-hardware-devel on this list. Posting here will likely get you more attention from knowledgable people.<br>
Chris<br>