Changeset View
Changeset View
Standalone View
Standalone View
applets/kicker/plugin/rootmodel.cpp
Context not available. | |||||
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) | ||
Context not available. | |||||
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; | ||
Context not available. | |||||
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 | | |||
Context not available. |