Changeset View
Changeset View
Standalone View
Standalone View
solid-device-automounter/kcm/DeviceModel.h
Show All 21 Lines | |||||
22 | #define DEVICEMODEL_H | 22 | #define DEVICEMODEL_H | ||
23 | 23 | | |||
24 | #include <QAbstractItemModel> | 24 | #include <QAbstractItemModel> | ||
25 | #include <QModelIndex> | 25 | #include <QModelIndex> | ||
26 | #include <QVariant> | 26 | #include <QVariant> | ||
27 | #include <QList> | 27 | #include <QList> | ||
28 | #include <QHash> | 28 | #include <QHash> | ||
29 | 29 | | |||
30 | class AutomounterSettings; | ||||
31 | | ||||
30 | class DeviceModel : public QAbstractItemModel | 32 | class DeviceModel : public QAbstractItemModel | ||
31 | { | 33 | { | ||
32 | Q_OBJECT | 34 | Q_OBJECT | ||
33 | 35 | | |||
34 | public: | 36 | public: | ||
35 | explicit DeviceModel(QObject *parent = nullptr); | 37 | explicit DeviceModel(AutomounterSettings *m_settings, QObject *parent = nullptr); | ||
ervin: parent should come last and keep the = nullptr | |||||
36 | ~DeviceModel() override = default; | 38 | ~DeviceModel() override = default; | ||
37 | 39 | | |||
38 | enum DeviceType { | 40 | enum DeviceType { | ||
39 | Attached, | 41 | Attached, | ||
40 | Detatched | 42 | Detatched | ||
41 | }; | 43 | }; | ||
42 | 44 | | |||
43 | enum { | 45 | enum { | ||
Show All 28 Lines | 73 | private: | |||
72 | void addNewDevice(const QString &udi); | 74 | void addNewDevice(const QString &udi); | ||
73 | 75 | | |||
74 | QList<QString> m_attached; | 76 | QList<QString> m_attached; | ||
75 | QList<QString> m_disconnected; | 77 | QList<QString> m_disconnected; | ||
76 | QHash<QString, bool> m_loginForced; | 78 | QHash<QString, bool> m_loginForced; | ||
77 | QHash<QString, bool> m_attachedForced; | 79 | QHash<QString, bool> m_attachedForced; | ||
78 | bool m_automaticLogin; | 80 | bool m_automaticLogin; | ||
79 | bool m_automaticAttached; | 81 | bool m_automaticAttached; | ||
82 | AutomounterSettings *m_settings; | ||||
80 | }; | 83 | }; | ||
81 | 84 | | |||
82 | #endif | 85 | #endif |
parent should come last and keep the = nullptr