Index: sources/storage/usbwatcher.cpp =================================================================== diff -u -r805119c460b4a266d6401c8705f4427e7fbe270f -r44a85c96ab55e424866ec4cca0270aa218355f82 --- sources/storage/usbwatcher.cpp (.../usbwatcher.cpp) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) +++ sources/storage/usbwatcher.cpp (.../usbwatcher.cpp) (revision 44a85c96ab55e424866ec4cca0270aa218355f82) @@ -1,15 +1,16 @@ /*! - * + * * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. - * copyright - * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, - * IN PART OR IN WHOLE, - * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. - * - * file usbwatcher.cpp - * date 12/31/2019 - * author Behrouz NematiPour - * + * \copyright + * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN + * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. + * + * \file usbwatcher.cpp + * \author (last) Behrouz NematiPour + * \date (last) 07-May-2020 + * \author (original) Behrouz NematiPour + * \date (original) 02-Jan-2020 + * */ #include "usbwatcher.h" @@ -78,7 +79,7 @@ { // coco begin validated: Application termination is not correctly done in coco!!! // it has been tested and works perfectly fine in normal run. - quitThread(); + quitThread(); // validated } // coco end @@ -124,7 +125,7 @@ if ( ! _thread ) return; // runs in thread - moveToThread(qApp->thread()); + moveToThread(qApp->thread()); // validated } // coco end @@ -138,6 +139,7 @@ */ bool USBWatcher::usbSeek(QString &vDevice) { + // coco begin validated: Needed User Interaction so tested manually QString device = ""; for (char a = 'a'; a <= 'z'; a++) { device = QString("/dev/sd%1%2").arg(a).arg('1'); @@ -148,6 +150,7 @@ } vDevice = device; return false; + // coco end } /*! @@ -169,6 +172,7 @@ */ void USBWatcher::usbcheck() { + // coco begin validated: Needed User Interaction so tested manually QString device = ""; if (usbSeek(device)) { if (! _umounted ) { @@ -181,6 +185,7 @@ usbRemove(); } } + // coco end } /*! @@ -202,9 +207,11 @@ error = tr("%1 - Device or resource busy (%2)").arg(errno).arg(vDevice); _mounted = true; break; + default: error = tr("%1 - %2 (%3 , %4)").arg(errno).arg(strerror(errno)).arg(vDevice).arg(USB_Mount_Point); break; + } if (error != lastError) { LOG_ERROR(error); @@ -220,8 +227,11 @@ */ void USBWatcher::onUSBDriveUmount() { + // coco begin validated: This needs user interaction to plug-in/out the USB device + // has been tested manually _umounted = true; } +// coco end /*! * \brief USBWatcher::usbMount