Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/rootmodel.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | { | 61 | { | ||
62 | return m_childModel; | 62 | return m_childModel; | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | RootModel::RootModel(QObject *parent) : AppsModel(QString(), parent) | 65 | RootModel::RootModel(QObject *parent) : AppsModel(QString(), parent) | ||
66 | , m_complete(false) | 66 | , m_complete(false) | ||
67 | , m_favorites(new FavoritesModel(this)) | 67 | , m_favorites(new FavoritesModel(this)) | ||
68 | , m_systemModel(nullptr) | 68 | , m_systemModel(nullptr) | ||
69 | , m_autoPopulate(true) | ||||
69 | , m_showAllApps(false) | 70 | , m_showAllApps(false) | ||
70 | , m_showRecentApps(true) | 71 | , m_showRecentApps(true) | ||
71 | , m_showRecentDocs(true) | 72 | , m_showRecentDocs(true) | ||
72 | , m_showRecentContacts(false) | 73 | , m_showRecentContacts(false) | ||
73 | , m_showPowerSession(true) | 74 | , m_showPowerSession(true) | ||
74 | , m_recentAppsModel(0) | 75 | , m_recentAppsModel(0) | ||
75 | , m_recentDocsModel(0) | 76 | , m_recentDocsModel(0) | ||
76 | , m_recentContactsModel(0) | 77 | , m_recentContactsModel(0) | ||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Line(s) | 122 | if (entry->type() == AbstractEntry::GroupType) { | |||
138 | } else if (entry->childModel()->hasActions()) { | 139 | } else if (entry->childModel()->hasActions()) { | ||
139 | return entry->childModel()->trigger(-1, actionId, QVariant()); | 140 | return entry->childModel()->trigger(-1, actionId, QVariant()); | ||
140 | } | 141 | } | ||
141 | } | 142 | } | ||
142 | 143 | | |||
143 | return AppsModel::trigger(row, actionId, argument); | 144 | return AppsModel::trigger(row, actionId, argument); | ||
144 | } | 145 | } | ||
145 | 146 | | |||
147 | bool RootModel::autoPopulate() const | ||||
148 | { | ||||
149 | return m_autoPopulate; | ||||
150 | } | ||||
151 | | ||||
152 | void RootModel::setAutoPopulate(bool populate) | ||||
153 | { | ||||
154 | if (m_autoPopulate != populate) { | ||||
155 | m_autoPopulate = populate; | ||||
156 | | ||||
157 | emit autoPopulateChanged(); | ||||
158 | } | ||||
159 | } | ||||
146 | 160 | | |||
147 | bool RootModel::showAllApps() const | 161 | bool RootModel::showAllApps() const | ||
148 | { | 162 | { | ||
149 | return m_showAllApps; | 163 | return m_showAllApps; | ||
150 | } | 164 | } | ||
151 | 165 | | |||
152 | void RootModel::setShowAllApps(bool show) | 166 | void RootModel::setShowAllApps(bool show) | ||
153 | { | 167 | { | ||
▲ Show 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | |||||
241 | void RootModel::classBegin() | 255 | void RootModel::classBegin() | ||
242 | { | 256 | { | ||
243 | } | 257 | } | ||
244 | 258 | | |||
245 | void RootModel::componentComplete() | 259 | void RootModel::componentComplete() | ||
246 | { | 260 | { | ||
247 | m_complete = true; | 261 | m_complete = true; | ||
248 | 262 | | |||
263 | if (m_autoPopulate) { | ||||
249 | refresh(); | 264 | refresh(); | ||
250 | } | 265 | } | ||
266 | } | ||||
251 | 267 | | |||
252 | void RootModel::refresh() | 268 | void RootModel::refresh() | ||
253 | { | 269 | { | ||
254 | if (!m_complete) { | 270 | if (!m_complete) { | ||
255 | return; | 271 | return; | ||
256 | } | 272 | } | ||
257 | 273 | | |||
258 | beginResetModel(); | 274 | beginResetModel(); | ||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |