How to get USB device name and its relative mount point?
-
wrote on 28 Jun 2015, 21:11 last edited by
Hello every one, this is my first topic on this forum that looks very nice.
i would like to know how can i get the list of usb devices connected (i mean /dev/sd**) and their relative mount points (/media/user/USB for example)
I need to put them in a QComboBox;
i heard about libusb but after hours i still can't figure out how to get theese informations and how to convert them into a QStringListMy program must works on both windows and linux but on Windows i need only the drive letter.
Thank you for your help!
-
wrote on 28 Jun 2015, 21:17 last edited by
In Linux you could just parse /proc/mounts.
-
wrote on 28 Jun 2015, 21:21 last edited by
Yes but how can i get only the removable devices?
-
Hi,
Since you're on linux, did you took a look at KDE's Solid library ?
-
wrote on 28 Jun 2015, 22:43 last edited by
hi, thank you for your answer,
I didn't know that library so i've read this: https://techbase.kde.org/Development/Tutorials/Solid/Device_Discovery and to be honest it seems to be exactly what i need.
But i can't see how to use it:
i've added
LIBS += -lkdeui
to use kde classes but how can i add solid?
Thank you, -
wrote on 29 Jun 2015, 17:50 last edited by
i can't find any documentation on how to use this lib in my QT, project
1/7