Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/rootmodel.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 46 | private: | |||
---|---|---|---|---|---|
49 | QPointer<AbstractModel> m_childModel; | 49 | QPointer<AbstractModel> m_childModel; | ||
50 | }; | 50 | }; | ||
51 | 51 | | |||
52 | class RootModel : public AppsModel, public QQmlParserStatus | 52 | class RootModel : public AppsModel, public QQmlParserStatus | ||
53 | { | 53 | { | ||
54 | Q_OBJECT | 54 | Q_OBJECT | ||
55 | Q_INTERFACES(QQmlParserStatus) | 55 | Q_INTERFACES(QQmlParserStatus) | ||
56 | 56 | | |||
57 | Q_PROPERTY(bool autoPopulate READ autoPopulate WRITE setAutoPopulate NOTIFY autoPopulateChanged) | ||||
58 | | ||||
57 | Q_PROPERTY(QObject* systemFavoritesModel READ systemFavoritesModel NOTIFY systemFavoritesModelChanged) | 59 | Q_PROPERTY(QObject* systemFavoritesModel READ systemFavoritesModel NOTIFY systemFavoritesModelChanged) | ||
58 | Q_PROPERTY(bool showAllApps READ showAllApps WRITE setShowAllApps NOTIFY showAllAppsChanged) | 60 | Q_PROPERTY(bool showAllApps READ showAllApps WRITE setShowAllApps NOTIFY showAllAppsChanged) | ||
59 | Q_PROPERTY(bool showRecentApps READ showRecentApps WRITE setShowRecentApps NOTIFY showRecentAppsChanged) | 61 | Q_PROPERTY(bool showRecentApps READ showRecentApps WRITE setShowRecentApps NOTIFY showRecentAppsChanged) | ||
60 | Q_PROPERTY(bool showRecentDocs READ showRecentDocs WRITE setShowRecentDocs NOTIFY showRecentDocsChanged) | 62 | Q_PROPERTY(bool showRecentDocs READ showRecentDocs WRITE setShowRecentDocs NOTIFY showRecentDocsChanged) | ||
61 | Q_PROPERTY(bool showRecentContacts READ showRecentContacts WRITE setShowRecentContacts NOTIFY showRecentContactsChanged) | 63 | Q_PROPERTY(bool showRecentContacts READ showRecentContacts WRITE setShowRecentContacts NOTIFY showRecentContactsChanged) | ||
62 | Q_PROPERTY(bool showPowerSession READ showPowerSession WRITE setShowPowerSession NOTIFY showPowerSessionChanged) | 64 | Q_PROPERTY(bool showPowerSession READ showPowerSession WRITE setShowPowerSession NOTIFY showPowerSessionChanged) | ||
63 | 65 | | |||
64 | public: | 66 | public: | ||
65 | explicit RootModel(QObject *parent = 0); | 67 | explicit RootModel(QObject *parent = 0); | ||
66 | ~RootModel(); | 68 | ~RootModel(); | ||
67 | 69 | | |||
68 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; | 70 | QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; | ||
69 | 71 | | |||
70 | Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument); | 72 | Q_INVOKABLE virtual bool trigger(int row, const QString &actionId, const QVariant &argument); | ||
71 | 73 | | |||
74 | bool autoPopulate() const; | ||||
75 | void setAutoPopulate(bool populate); | ||||
76 | | ||||
72 | bool showAllApps() const; | 77 | bool showAllApps() const; | ||
73 | void setShowAllApps(bool show); | 78 | void setShowAllApps(bool show); | ||
74 | 79 | | |||
75 | bool showRecentApps() const; | 80 | bool showRecentApps() const; | ||
76 | void setShowRecentApps(bool show); | 81 | void setShowRecentApps(bool show); | ||
77 | 82 | | |||
78 | bool showRecentDocs() const; | 83 | bool showRecentDocs() const; | ||
79 | void setShowRecentDocs(bool show); | 84 | void setShowRecentDocs(bool show); | ||
80 | 85 | | |||
81 | bool showRecentContacts() const; | 86 | bool showRecentContacts() const; | ||
82 | void setShowRecentContacts(bool show); | 87 | void setShowRecentContacts(bool show); | ||
83 | 88 | | |||
84 | bool showPowerSession() const; | 89 | bool showPowerSession() const; | ||
85 | void setShowPowerSession(bool show); | 90 | void setShowPowerSession(bool show); | ||
86 | 91 | | |||
87 | AbstractModel* favoritesModel(); | 92 | AbstractModel* favoritesModel(); | ||
88 | AbstractModel* systemFavoritesModel(); | 93 | AbstractModel* systemFavoritesModel(); | ||
89 | 94 | | |||
90 | void classBegin() override; | 95 | void classBegin() override; | ||
91 | void componentComplete() override; | 96 | void componentComplete() override; | ||
92 | 97 | | |||
93 | Q_SIGNALS: | 98 | Q_SIGNALS: | ||
94 | void refreshed() const; | 99 | void refreshed() const; | ||
95 | void systemFavoritesModelChanged() const; | 100 | void systemFavoritesModelChanged() const; | ||
101 | void autoPopulateChanged() const; | ||||
96 | void showAllAppsChanged() const; | 102 | void showAllAppsChanged() const; | ||
97 | void showRecentAppsChanged() const; | 103 | void showRecentAppsChanged() const; | ||
98 | void showRecentDocsChanged() const; | 104 | void showRecentDocsChanged() const; | ||
99 | void showRecentContactsChanged() const; | 105 | void showRecentContactsChanged() const; | ||
100 | void showPowerSessionChanged() const; | 106 | void showPowerSessionChanged() const; | ||
101 | void recentAppsModelChanged() const; | 107 | void recentAppsModelChanged() const; | ||
102 | 108 | | |||
103 | protected Q_SLOTS: | 109 | protected Q_SLOTS: | ||
104 | void refresh(); | 110 | void refresh(); | ||
105 | 111 | | |||
106 | private: | 112 | private: | ||
107 | bool m_complete; | 113 | bool m_complete; | ||
108 | 114 | | |||
109 | FavoritesModel *m_favorites; | 115 | FavoritesModel *m_favorites; | ||
110 | SystemModel *m_systemModel; | 116 | SystemModel *m_systemModel; | ||
111 | 117 | | |||
118 | bool m_autoPopulate; | ||||
119 | | ||||
112 | bool m_showAllApps; | 120 | bool m_showAllApps; | ||
113 | bool m_showRecentApps; | 121 | bool m_showRecentApps; | ||
114 | bool m_showRecentDocs; | 122 | bool m_showRecentDocs; | ||
115 | bool m_showRecentContacts; | 123 | bool m_showRecentContacts; | ||
116 | bool m_showPowerSession; | 124 | bool m_showPowerSession; | ||
117 | 125 | | |||
118 | RecentUsageModel *m_recentAppsModel; | 126 | RecentUsageModel *m_recentAppsModel; | ||
119 | RecentUsageModel *m_recentDocsModel; | 127 | RecentUsageModel *m_recentDocsModel; | ||
120 | RecentContactsModel *m_recentContactsModel; | 128 | RecentContactsModel *m_recentContactsModel; | ||
121 | }; | 129 | }; | ||
122 | 130 | | |||
123 | #endif | 131 | #endif |