Index: sources/storage/filehandler.h =================================================================== diff -u -r90d3f5b31186834168c9ad869f8d2d038200dfcf -rfbeafa0714f065bce0403e2e8ce68f6d8fbea6bd --- sources/storage/filehandler.h (.../filehandler.h) (revision 90d3f5b31186834168c9ad869f8d2d038200dfcf) +++ sources/storage/filehandler.h (.../filehandler.h) (revision fbeafa0714f065bce0403e2e8ce68f6d8fbea6bd) @@ -16,8 +16,13 @@ // Qt #include #include + // Project +#include "main.h" +// Define +#define _FileHandler FileHandler::I() + namespace Storage { class FileHandler : public QObject @@ -27,22 +32,41 @@ const char *_usbMount = "/media/usb/"; const char *_usbfsys = "vfat"; bool _mounted = false; + bool _umounted = false; + const char *_usbDrive = ""; - QFileSystemWatcher fsWatcher; - + // Singleton + SINGLETON_DECL(FileHandler) public: - explicit FileHandler(QObject *parent = nullptr); - bool init(); + void quit(); + bool doExport(); bool doImport(); + bool umounted( ) const; + void umounted(bool vUmounted); + +private: + void initConnections(); + + bool usbSeek(QString &vDevice); + signals: - void usbStatusChanged(bool available); + void didUSBDriveMount (); + void didUSBDriveUmount(); + void didUSBDriveRemove(); +public slots: + void doUSBDriveMount (); + private slots: - void directoryChanged(const QString &vPath); - bool mountUsb(QString device); + bool usbMount (const QString &vDevice); + bool usbUmount(const QString &vDevice); + void usbRemove(); + void usbError (const QString &vDevice); + + void onMainTimerTimeout(); }; }