Index: sources/storage/usbwatcher.cpp =================================================================== diff -u -r862dc0590b73c618fac73dce2c976e3526e0404a -r805119c460b4a266d6401c8705f4427e7fbe270f --- sources/storage/usbwatcher.cpp (.../usbwatcher.cpp) (revision 862dc0590b73c618fac73dce2c976e3526e0404a) +++ sources/storage/usbwatcher.cpp (.../usbwatcher.cpp) (revision 805119c460b4a266d6401c8705f4427e7fbe270f) @@ -29,6 +29,12 @@ // namespace using namespace Storage; +/*! + * \brief USBWatcher::USBWatcher + * \details Constructor + * \param parent - QObject parent owner object. + * Qt handles the children destruction by their parent objects life-cycle. + */ USBWatcher::USBWatcher(QObject *parent) : QObject(parent) { } /*! @@ -43,7 +49,7 @@ // runs in USBWatcher thread initConnections(); - startTimer(_checkInterval); + startTimer(_interval); return true; } @@ -70,8 +76,11 @@ */ void USBWatcher::quit() { + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. quitThread(); } +// coco end /*! * \brief USBWatcher::initConnections @@ -109,11 +118,15 @@ */ void USBWatcher::quitThread() { + // coco begin validated: Application termination is not correctly done in coco!!! + // it has been tested and works perfectly fine in normal run. + if ( ! _thread ) return; // runs in thread moveToThread(qApp->thread()); } +// coco end /*! * \brief USBWatcher::usbSeek @@ -180,6 +193,8 @@ */ void USBWatcher::usbError(const QString &vDevice) { + // coco begin validated: This needs user interaction to plug-in/out the USB device + // has been tested manually QString error; static QString lastError; switch (errno) { @@ -196,6 +211,7 @@ lastError = error; } } +// coco end /*! * \brief USBWatcher::onUSBDriveUmount @@ -216,6 +232,8 @@ */ bool USBWatcher::usbMount(const QString &vDevice) { + // coco begin validated: This needs user interaction to plug-in the USB device + // has been tested manually bool ok; _usbDrive = vDevice.toLatin1().constData(); ok = ::mount(_usbDrive, USB_Mount_Point, USB_File_System, 0, "") == 0; @@ -229,6 +247,7 @@ } return ok; } +// coco end /*! * \brief USBWatcher::usbUmount @@ -239,8 +258,10 @@ */ bool USBWatcher::usbUmount(const QString &vDevice) { + // coco begin validated: This needs user interaction to plug-out the USB device + // has been tested manually bool ok; - ok = umount(vDevice.toLatin1().constData()) == 0; + ok = ::umount(vDevice.toLatin1().constData()) == 0; if (ok) { _mounted = false; LOG_EVENT(tr("USB drive unmounted")); @@ -251,6 +272,7 @@ } return ok; } +// coco end /*! * \brief USBWatcher::usbRemove @@ -260,9 +282,12 @@ */ void USBWatcher::usbRemove() { + // coco begin validated: This needs user interaction to plug-out the USB device + // has been tested manually usbUmount(USB_Mount_Point); _umounted = false; _removed = true; LOG_EVENT(tr("USB drive removed")); emit didUSBDriveRemove(); } +// coco end