| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#pragma once |
| 6 |
#include "deviceinfo.h" |
| 7 |
|
| 8 |
#include <QObject> |
| 9 |
#include <QTimer> |
| 10 |
|
| 11 |
class DeviceMonitor : public QObject |
| 12 |
{ |
| 13 |
Q_OBJECT |
| 14 |
public: |
| 15 |
explicit DeviceMonitor(QObject *parent = nullptr); |
| 16 |
~DeviceMonitor() { |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
private: |
| 21 |
QList<DeviceInfo> getIntersectDevice(const QList<DeviceInfo>& list); |
| 22 |
static QList<DeviceInfo> getNorDevice(const QList<DeviceInfo>& calcuList, const QList<DeviceInfo>& refList); |
| 23 |
|
| 24 |
signals: |
| 25 |
void startMonitor(); |
| 26 |
void pauseMonitor(); |
| 27 |
void removablePartitionsChanged(const QList<DeviceInfo> &addlist, const QList<DeviceInfo>& reducelist); |
| 28 |
|
| 29 |
public slots: |
| 30 |
const QList<DeviceInfo> deviceList() const; |
| 31 |
|
| 32 |
private: |
| 33 |
QTimer *m_timer = nullptr; |
| 34 |
QList<DeviceInfo> m_deviceList; |
| 35 |
}; |