Index: sources/storage/DriveWatcher.cpp =================================================================== diff -u -re159592e3a99658e661ab83fffef43322dc075f3 -ra64c31ec79b3af203691f70397cc31f5727f47f4 --- sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision e159592e3a99658e661ab83fffef43322dc075f3) +++ sources/storage/DriveWatcher.cpp (.../DriveWatcher.cpp) (revision a64c31ec79b3af203691f70397cc31f5727f47f4) @@ -152,9 +152,17 @@ bool DriveWatcher::usbSeek(QString &vDevice) { // coco begin validated: Needed User Interaction so tested manually + // This function cannot be tested on any device other than target + // because only on device the usb is /dev/sdX# and others are mmblk___ + // but on VM and normal Linuxes all drives are /dev/sdX# and cannot be identified as USB. + // And the difference between how USB is detected and sd-card is that + // for the USB we need to look into /dev/sdX# + // but for the sd-card we look for the mounted path which is much easier. + // That's why indication of the sd-card is more accurate than USB at least on VM. + QString dev = "/dev/sd"; QString device = ""; for (char a = 'a'; a <= 'z'; a++) { - device = QString("/dev/sd%1%2").arg(a).arg('1'); + device = dev + a + '1'; if (QFileInfo::exists(device)) { vDevice = device; return true; // application is deciding on the first existing drive