Index: sources/storage/usbwatcher.h =================================================================== diff -u -r5e78f0799b46963feb5756decb1a27b952cd19b3 -r56d00a82669a7a2c00ab90109a89dbec8db27527 --- sources/storage/usbwatcher.h (.../usbwatcher.h) (revision 5e78f0799b46963feb5756decb1a27b952cd19b3) +++ sources/storage/usbwatcher.h (.../usbwatcher.h) (revision 56d00a82669a7a2c00ab90109a89dbec8db27527) @@ -18,6 +18,7 @@ // Project #include "main.h" +#include "threads.h" // Define #define _USBWatcher Storage::USBWatcher::I() @@ -34,25 +35,30 @@ const char *_usbDrive = ""; const int _checkInterval = 1000; // in ms + QThread *_thread = nullptr; + bool _init = false; + // Singleton SINGLETON(USBWatcher) -public: +public slots: bool init(); + bool init(QThread &vThread); + +private slots: void quit(); - protected: void timerEvent(QTimerEvent *) override; private: void initConnections(); + void initThread(QThread &vThread); + void quitThread(); + bool usbSeek(QString &vDevice); - bool isMounted () const; - bool isUmounted() const; - signals: void didUSBDriveMount (); void didUSBDriveUmount();