Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/systemmodel.h
Show All 15 Lines | |||||
16 | * Free Software Foundation, Inc., * | 16 | * Free Software Foundation, Inc., * | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | 17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * | ||
18 | ***************************************************************************/ | 18 | ***************************************************************************/ | ||
19 | 19 | | |||
20 | #ifndef SYSTEMMODEL_H | 20 | #ifndef SYSTEMMODEL_H | ||
21 | #define SYSTEMMODEL_H | 21 | #define SYSTEMMODEL_H | ||
22 | 22 | | |||
23 | #include "abstractmodel.h" | 23 | #include "abstractmodel.h" | ||
24 | 24 | #include "systementry.h" | |||
25 | class SystemEntry; | | |||
26 | 25 | | |||
27 | class SystemModel : public AbstractModel | 26 | class SystemModel : public AbstractModel | ||
28 | { | 27 | { | ||
29 | Q_OBJECT | 28 | Q_OBJECT | ||
30 | 29 | | |||
31 | public: | 30 | public: | ||
32 | explicit SystemModel(QObject *parent = nullptr); | 31 | explicit SystemModel(QObject *parent = nullptr); | ||
33 | ~SystemModel() override; | 32 | ~SystemModel() override; | ||
34 | 33 | | |||
35 | QString description() const override; | 34 | QString description() const override; | ||
36 | 35 | | |||
37 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | 36 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; | ||
38 | 37 | | |||
39 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | 38 | int rowCount(const QModelIndex &parent = QModelIndex()) const override; | ||
40 | 39 | | |||
41 | Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) override; | 40 | Q_INVOKABLE bool trigger(int row, const QString &actionId, const QVariant &argument) override; | ||
42 | 41 | | |||
43 | protected Q_SLOTS: | 42 | protected Q_SLOTS: | ||
44 | void refresh() override; | 43 | void refresh() override; | ||
45 | 44 | | |||
46 | private: | 45 | private: | ||
47 | void init(); | 46 | QHash<SystemEntry::Action, SystemEntry *> m_entries; | ||
48 | | ||||
49 | QList<SystemEntry *> m_entryList; | | |||
50 | }; | 47 | }; | ||
51 | 48 | | |||
52 | #endif | 49 | #endif |