How to list the external devices using QT Dbus?
I want to create a file dialog which can list the only external devices connected to the system,like USB.
I am using QDBusAbstractInterface class. I am calling the function
FindDeviceByCapability("storage"); but this function list me all the storage devices. But i am only interested in external USB devices. Is there some other parameter to pass.
Also what i am getting as output is something like
/org/freedesktop/Hal/devices/storage_serial_Kingston_DataTraveler_102_001372982 955A9C0E6C50103_0_0
But i want the path of the mounted devices,so that when it is displayed in the file dialog user can browse it.
Re: How to list the external devices using QT Dbus?
Have a look at fstab & getmntent.htm
But even with those, it's going to be difficult to detect if a device is connected via USB or not, as to an application, it's transparent.
Re: How to list the external devices using QT Dbus?
Can't i do it with out using the unix system commands?
Re: How to list the external devices using QT Dbus?
Qt has no support for what you want to do, so you need to use OS-specific commands to do it.