Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/rootmodel.cpp
Show First 20 Lines • Show All 65 Lines • ▼ Show 20 Line(s) | |||||
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_autoPopulate(true) | ||
70 | , m_showAllApps(false) | 70 | , m_showAllApps(false) | ||
71 | , m_showRecentApps(true) | 71 | , m_showRecentApps(true) | ||
72 | , m_showRecentDocs(true) | 72 | , m_showRecentDocs(true) | ||
73 | , m_showRecentContacts(false) | 73 | , m_showRecentContacts(false) | ||
74 | , m_recentOrdering(RecentUsageModel::Recent) | ||||
74 | , m_showPowerSession(true) | 75 | , m_showPowerSession(true) | ||
75 | , m_recentAppsModel(0) | 76 | , m_recentAppsModel(0) | ||
76 | , m_recentDocsModel(0) | 77 | , m_recentDocsModel(0) | ||
77 | , m_recentContactsModel(0) | 78 | , m_recentContactsModel(0) | ||
78 | { | 79 | { | ||
79 | } | 80 | } | ||
80 | 81 | | |||
81 | RootModel::~RootModel() | 82 | RootModel::~RootModel() | ||
▲ Show 20 Lines • Show All 135 Lines • ▼ Show 20 Line(s) | 217 | if (show != m_showRecentContacts) { | |||
217 | m_showRecentContacts = show; | 218 | m_showRecentContacts = show; | ||
218 | 219 | | |||
219 | refresh(); | 220 | refresh(); | ||
220 | 221 | | |||
221 | emit showRecentContactsChanged(); | 222 | emit showRecentContactsChanged(); | ||
222 | } | 223 | } | ||
223 | } | 224 | } | ||
224 | 225 | | |||
226 | int RootModel::recentOrdering() const | ||||
227 | { | ||||
228 | return m_recentOrdering; | ||||
229 | } | ||||
230 | | ||||
231 | void RootModel::setRecentOrdering(int ordering) | ||||
232 | { | ||||
233 | if (ordering != m_recentOrdering) { | ||||
234 | m_recentOrdering = ordering; | ||||
235 | | ||||
236 | refresh(); | ||||
237 | | ||||
238 | emit recentOrderingChanged(); | ||||
239 | } | ||||
240 | } | ||||
241 | | ||||
225 | bool RootModel::showPowerSession() const | 242 | bool RootModel::showPowerSession() const | ||
226 | { | 243 | { | ||
227 | return m_showPowerSession; | 244 | return m_showPowerSession; | ||
228 | } | 245 | } | ||
229 | 246 | | |||
230 | void RootModel::setShowPowerSession(bool show) | 247 | void RootModel::setShowPowerSession(bool show) | ||
231 | { | 248 | { | ||
232 | if (show != m_showPowerSession) { | 249 | if (show != m_showPowerSession) { | ||
▲ Show 20 Lines • Show All 154 Lines • ▼ Show 20 Line(s) | 286 | { | |||
387 | 404 | | |||
388 | if (m_showRecentContacts) { | 405 | if (m_showRecentContacts) { | ||
389 | m_recentContactsModel = new RecentContactsModel(this); | 406 | m_recentContactsModel = new RecentContactsModel(this); | ||
390 | m_entryList.prepend(new GroupEntry(this, i18n("Recent Contacts"), QString(), m_recentContactsModel)); | 407 | m_entryList.prepend(new GroupEntry(this, i18n("Recent Contacts"), QString(), m_recentContactsModel)); | ||
391 | ++separatorPosition; | 408 | ++separatorPosition; | ||
392 | } | 409 | } | ||
393 | 410 | | |||
394 | if (m_showRecentDocs) { | 411 | if (m_showRecentDocs) { | ||
395 | m_recentDocsModel = new RecentUsageModel(this, RecentUsageModel::OnlyDocs); | 412 | m_recentDocsModel = new RecentUsageModel(this, RecentUsageModel::OnlyDocs, m_recentOrdering); | ||
396 | m_entryList.prepend(new GroupEntry(this, i18n("Recent Documents"), QString(), m_recentDocsModel)); | 413 | m_entryList.prepend(new GroupEntry(this, | ||
414 | m_recentOrdering == RecentUsageModel::Recent | ||||
415 | ? i18n("Recent Documents") | ||||
416 | : i18n("Often Used Documents"), | ||||
417 | QString(), | ||||
418 | m_recentDocsModel)); | ||||
397 | ++separatorPosition; | 419 | ++separatorPosition; | ||
398 | } | 420 | } | ||
399 | 421 | | |||
400 | if (m_showRecentApps) { | 422 | if (m_showRecentApps) { | ||
401 | m_recentAppsModel = new RecentUsageModel(this, RecentUsageModel::OnlyApps); | 423 | m_recentAppsModel = new RecentUsageModel(this, RecentUsageModel::OnlyApps, m_recentOrdering); | ||
402 | m_entryList.prepend(new GroupEntry(this, i18n("Recent Applications"), QString(), m_recentAppsModel)); | 424 | m_entryList.prepend(new GroupEntry(this, | ||
425 | m_recentOrdering == RecentUsageModel::Recent | ||||
426 | ? i18n("Recent Applications") | ||||
427 | : i18n("Often Used Applications"), | ||||
428 | QString(), | ||||
429 | m_recentAppsModel)); | ||||
403 | ++separatorPosition; | 430 | ++separatorPosition; | ||
404 | } | 431 | } | ||
405 | 432 | | |||
406 | if (m_showSeparators && separatorPosition > 0) { | 433 | if (m_showSeparators && separatorPosition > 0) { | ||
407 | m_entryList.insert(separatorPosition, new SeparatorEntry(this)); | 434 | m_entryList.insert(separatorPosition, new SeparatorEntry(this)); | ||
408 | ++m_separatorCount; | 435 | ++m_separatorCount; | ||
409 | } | 436 | } | ||
410 | 437 | | |||
Show All 16 Lines |