Chis your answers are clear as day, but I still can't get the filePath.to print out.<br><br>So this is what I have, pretty much verbatim of what you have:<br>MySlot(QString str)<br>{<br> QString filePath;<br> Solid::Device device(str);<br>
Solid::StorageAccess *storageAccess = <a href="http://device.as">device.as</a><Solid::StorageAccess>();<br> if(storageAccess) {<br> if(!storageAccess->isAccessible()) { //device is plugged in but not mounted<br>
qDebug() << "Make accesible...";<br> storageAccess->setup();<br> }<br> qDebug() << "File path is: " << storageAccess->filePath();<br> setupSelectedSlot(SetupDashBoardView::FileSettings);<br>
}<br><br>Here is the output form the command line when a usb is device is loaded (the results are the same on two computers)<br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774"<br>
Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0"<br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host"<br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host_scsi_device_lun0"<br>
Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host_scsi_device_lun0_scsi_generic"<br>Device changed "/org/freedesktop/Hal/devices/storage_serial_Kingston_DataTraveler_2_0_0000024774_0_0"<br>
Device changed "/org/freedesktop/Hal/devices/volume_uuid_7062_BD74"<br>Make accesible...<br>File path is: ""<br><br>As you can see setup() is called. <br><br><br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774"<br>
Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0"<br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host"<br>Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host_scsi_device_lun0"<br>
Device changed "/org/freedesktop/Hal/devices/usb_device_951_1603_0000024774_if0_scsi_host_scsi_device_lun0_scsi_generic"<br>Device changed "/org/freedesktop/Hal/devices/storage_serial_Kingston_DataTraveler_2_0_0000024774_0_0"<br>
Device changed "/org/freedesktop/Hal/devices/volume_uuid_7062_BD74"<br>Make accesible...<br>File path is: ""<br><br>Could it be a timing issue. Or do you have any ideas<br><br>Regards<br>David<br><br>
<br><br><div class="gmail_quote">On Tue, Jun 10, 2008 at 7:10 PM, Christopher Blauvelt <<a href="mailto:cblauvelt@gmail.com">cblauvelt@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;">
<div class="Ih2E3d"><br><br><div class="gmail_quote">On Tue, Jun 10, 2008 at 7:31 PM, David Boosalis <<a href="mailto:david.boosalis@gmail.com" target="_blank">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 Chris.<br><br>The signal gets generated from a USB being plugged in. I use the following to connect the signal to the slog given:<br><br> connect(DeviceNotifier::instance(), <br> SIGNAL(deviceAdded(const QString &)),<br>
this, <br> SLOT(slotSolidDeviceChanged(const QString &)));<br> <br> connect(Solid::DeviceNotifier::instance(), <br> SIGNAL(deviceRemoved(const QString &)),<br> this, <br> SLOT(slotSolidDeviceChanged(const QString &)));<br>
<br>This was taken from the solid tutorial. Maybe I am getting an extraneous signal when I plug in the usb stick because the qDebug statement for filePath below prints nothing for hte filePath argument. I am using hte latest build of the depot for all my coding work. You mentioned something about StorgeAccess::setup(), I'll research this call, as I am not sure where to put it.<br>
<br></blockquote></div></div>filePath() gives you the path to where the device is *mounted*. The signal you're receiving is sent when the device is plugged in, regardless of whether it's mounted or not. If you plug in your USB device, and it's not mounted you catch the signal that a device was added but since it's not mounted filePath() will return QString().<br>
<br>Try this in your slot:<div class="Ih2E3d"><br>qDebug() << "Device changed " << str;<br> QString filePath;<br> Solid::Device device(str);<br></div> Solid::StorageAccess *accessStorage = <a href="http://device.as" target="_blank">device.as</a><Solid::StorageAccess>();<br>
if(storageAccess) {<br> if(!storageAccess->isAccessible()) { //device is plugged in but not mounted<br> storageAccess->setup();<br> }<br> qDebug() << "File path is: " << storageAccess->filePath();<br>
}<br>
<br><br>
>> Visit <a href="http://mail.kde.org/mailman/listinfo/kde-devel#unsub" target="_blank">http://mail.kde.org/mailman/listinfo/kde-devel#unsub</a> to unsubscribe <<<br>
<br></blockquote></div><br>