DiskDeviceWatcher.h 670 B

12345678910111213141516171819202122232425262728
  1. #ifndef DISKDEVICEWATCHER_H
  2. #define DISKDEVICEWATCHER_H
  3. #include <QObject>
  4. #include <QScopedPointer>
  5. class DiskDeviceWatcherPrivate;
  6. class DiskDeviceWatcher : public QObject
  7. {
  8. Q_OBJECT
  9. Q_DISABLE_COPY(DiskDeviceWatcher)
  10. public:
  11. enum Action {
  12. A_Add = 0,
  13. A_Remove = 1,
  14. };
  15. explicit DiskDeviceWatcher(QObject *parent = NULL);
  16. ~DiskDeviceWatcher();
  17. signals:
  18. void diskDeviceChange(const QString &device, const DiskDeviceWatcher::Action action);
  19. private slots:
  20. void onSocketNotifier();
  21. private:
  22. friend class DiskDeviceWatcherPrivate;
  23. QScopedPointer<DiskDeviceWatcherPrivate> m_Private;
  24. };
  25. #endif // DISKDEVICEWATCHER_H