Changeset View
Changeset View
Standalone View
Standalone View
interfaces/devicesmodel.h
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | 41 | public: | |||
---|---|---|---|---|---|
66 | void setDisplayFilter(int flags); | 66 | void setDisplayFilter(int flags); | ||
67 | int displayFilter() const; | 67 | int displayFilter() const; | ||
68 | 68 | | |||
69 | QVariant data(const QModelIndex& index, int role) const override; | 69 | QVariant data(const QModelIndex& index, int role) const override; | ||
70 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | 70 | int rowCount(const QModelIndex& parent = QModelIndex()) const override; | ||
71 | 71 | | |||
72 | Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; | 72 | Q_SCRIPTABLE DeviceDbusInterface* getDevice(int row) const; | ||
73 | QHash<int, QByteArray> roleNames() const override; | 73 | QHash<int, QByteArray> roleNames() const override; | ||
74 | int rowForDevice(const QString& id) const; | ||||
74 | 75 | | |||
75 | private Q_SLOTS: | 76 | private Q_SLOTS: | ||
76 | void deviceAdded(const QString& id); | 77 | void deviceAdded(const QString& id); | ||
77 | void deviceRemoved(const QString& id); | 78 | void deviceRemoved(const QString& id); | ||
78 | void deviceUpdated(const QString& id, bool isVisible); | 79 | void deviceUpdated(const QString& id, bool isVisible); | ||
79 | void refreshDeviceList(); | 80 | void refreshDeviceList(); | ||
80 | void receivedDeviceList(QDBusPendingCallWatcher* watcher); | 81 | void receivedDeviceList(QDBusPendingCallWatcher* watcher); | ||
81 | void nameChanged(const QString& newName); | 82 | void nameChanged(const QString& newName); | ||
82 | 83 | | |||
83 | Q_SIGNALS: | 84 | Q_SIGNALS: | ||
84 | void rowsChanged(); | 85 | void rowsChanged(); | ||
85 | 86 | | |||
86 | private: | 87 | private: | ||
87 | int rowForDevice(const QString& id) const; | | |||
88 | void clearDevices(); | 88 | void clearDevices(); | ||
89 | void appendDevice(DeviceDbusInterface* dev); | 89 | void appendDevice(DeviceDbusInterface* dev); | ||
90 | bool passesFilter(DeviceDbusInterface* dev) const; | 90 | bool passesFilter(DeviceDbusInterface* dev) const; | ||
91 | 91 | | |||
92 | DaemonDbusInterface* m_dbusInterface; | 92 | DaemonDbusInterface* m_dbusInterface; | ||
93 | QVector<DeviceDbusInterface*> m_deviceList; | 93 | QVector<DeviceDbusInterface*> m_deviceList; | ||
94 | StatusFilterFlag m_displayFilter; | 94 | StatusFilterFlag m_displayFilter; | ||
95 | }; | 95 | }; | ||
96 | 96 | | |||
97 | //Q_DECLARE_OPERATORS_FOR_FLAGS(DevicesModel::StatusFilterFlag) | 97 | //Q_DECLARE_OPERATORS_FOR_FLAGS(DevicesModel::StatusFilterFlag) | ||
98 | 98 | | |||
99 | #endif // DEVICESMODEL_H | 99 | #endif // DEVICESMODEL_H |