/*! * * Copyright (c) 2019-2019 Diality Inc. - All Rights Reserved. * \copyright \n * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, \n * IN PART OR IN WHOLE, \n * WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. \n * * \file filehandler.h * \date 2019/09/30 * \author Behrouz NematiPour * */ #pragma once // Qt #include #include // Project #include "main.h" // Define #define _FileHandler FileHandler::I() namespace Storage { class FileHandler : public QObject { Q_OBJECT const char *_usbMount = "/media/usb/"; const char *_usbfsys = "vfat"; bool _mounted = false; bool _umounted = false; const char *_usbDrive = ""; // Singleton SINGLETON_DECL(FileHandler) public: bool init(); void quit(); bool doExport(); bool doImport(); bool umounted( ) const; void umounted(bool vUmounted); private: void initConnections(); bool usbSeek(QString &vDevice); signals: void didUSBDriveMount (); void didUSBDriveUmount(); void didUSBDriveRemove(); public slots: void doUSBDriveMount (); private slots: bool usbMount (const QString &vDevice); bool usbUmount(const QString &vDevice); void usbRemove(); void usbError (const QString &vDevice); void onMainTimerTimeout(); }; }