Changeset View
Changeset View
Standalone View
Standalone View
libtaskmanager/xwindowtasksmodel.cpp
Show First 20 Lines • Show All 110 Lines • ▼ Show 20 Line(s) | 107 | auto clearCacheAndRefresh = [this] { | |||
---|---|---|---|---|---|
111 | 111 | | |||
112 | appDataCache.clear(); | 112 | appDataCache.clear(); | ||
113 | 113 | | |||
114 | // Emit changes of all roles satisfied from app data cache. | 114 | // Emit changes of all roles satisfied from app data cache. | ||
115 | q->dataChanged(q->index(0, 0), q->index(windows.count() - 1, 0), | 115 | q->dataChanged(q->index(0, 0), q->index(windows.count() - 1, 0), | ||
116 | QVector<int>{Qt::DecorationRole, AbstractTasksModel::AppId, | 116 | QVector<int>{Qt::DecorationRole, AbstractTasksModel::AppId, | ||
117 | AbstractTasksModel::AppName, AbstractTasksModel::GenericName, | 117 | AbstractTasksModel::AppName, AbstractTasksModel::GenericName, | ||
118 | AbstractTasksModel::LauncherUrl, | 118 | AbstractTasksModel::LauncherUrl, | ||
119 | AbstractTasksModel::LauncherUrlWithoutIcon}); | 119 | AbstractTasksModel::LauncherUrlWithoutIcon, | ||
120 | AbstractTasksModel::SkipTaskbar}); | ||||
120 | }; | 121 | }; | ||
121 | 122 | | |||
122 | sycocaChangeTimer.setSingleShot(true); | 123 | sycocaChangeTimer.setSingleShot(true); | ||
123 | sycocaChangeTimer.setInterval(100); | 124 | sycocaChangeTimer.setInterval(100); | ||
124 | 125 | | |||
125 | QObject::connect(&sycocaChangeTimer, &QTimer::timeout, q, clearCacheAndRefresh); | 126 | QObject::connect(&sycocaChangeTimer, &QTimer::timeout, q, clearCacheAndRefresh); | ||
126 | 127 | | |||
127 | void (KSycoca::*myDatabaseChangeSignal)(const QStringList &) = &KSycoca::databaseChanged; | 128 | void (KSycoca::*myDatabaseChangeSignal)(const QStringList &) = &KSycoca::databaseChanged; | ||
▲ Show 20 Lines • Show All 197 Lines • ▼ Show 20 Line(s) | 319 | { | |||
325 | bool wipeInfoCache = false; | 326 | bool wipeInfoCache = false; | ||
326 | bool wipeAppDataCache = false; | 327 | bool wipeAppDataCache = false; | ||
327 | QVector<int> changedRoles; | 328 | QVector<int> changedRoles; | ||
328 | 329 | | |||
329 | if (properties & (NET::WMPid) | 330 | if (properties & (NET::WMPid) | ||
330 | || properties2 & (NET::WM2DesktopFileName | NET::WM2WindowClass)) { | 331 | || properties2 & (NET::WM2DesktopFileName | NET::WM2WindowClass)) { | ||
331 | wipeInfoCache = true; | 332 | wipeInfoCache = true; | ||
332 | wipeAppDataCache = true; | 333 | wipeAppDataCache = true; | ||
333 | changedRoles << Qt::DecorationRole << AppId << AppName << GenericName << LauncherUrl << AppPid; | 334 | changedRoles << Qt::DecorationRole << AppId << AppName << GenericName << LauncherUrl << AppPid << SkipTaskbar; | ||
334 | } | 335 | } | ||
335 | 336 | | |||
336 | if (properties & (NET::WMName | NET::WMVisibleName)) { | 337 | if (properties & (NET::WMName | NET::WMVisibleName)) { | ||
337 | changedRoles << Qt::DisplayRole; | 338 | changedRoles << Qt::DisplayRole; | ||
338 | wipeInfoCache = true; | 339 | wipeInfoCache = true; | ||
339 | } | 340 | } | ||
340 | 341 | | |||
341 | if ((properties & NET::WMIcon) && usingFallbackIcon.contains(window)) { | 342 | if ((properties & NET::WMIcon) && usingFallbackIcon.contains(window)) { | ||
▲ Show 20 Lines • Show All 298 Lines • ▼ Show 20 Line(s) | 573 | { | |||
640 | } else if (role == Activities) { | 641 | } else if (role == Activities) { | ||
641 | return d->windowInfo(window)->activities(); | 642 | return d->windowInfo(window)->activities(); | ||
642 | } else if (role == IsDemandingAttention) { | 643 | } else if (role == IsDemandingAttention) { | ||
643 | return d->demandsAttention(window); | 644 | return d->demandsAttention(window); | ||
644 | } else if (role == SkipTaskbar) { | 645 | } else if (role == SkipTaskbar) { | ||
645 | const KWindowInfo *info = d->windowInfo(window); | 646 | const KWindowInfo *info = d->windowInfo(window); | ||
646 | // _NET_WM_WINDOW_TYPE_UTILITY type windows should not be on task bars, | 647 | // _NET_WM_WINDOW_TYPE_UTILITY type windows should not be on task bars, | ||
647 | // but they should be shown on pagers. | 648 | // but they should be shown on pagers. | ||
648 | return (info->hasState(NET::SkipTaskbar) || info->windowType(NET::UtilityMask) == NET::Utility); | 649 | return (info->hasState(NET::SkipTaskbar) | ||
650 | || info->windowType(NET::UtilityMask) == NET::Utility | ||||
651 | || d->appData(window).skipTaskbar); | ||||
649 | } else if (role == SkipPager) { | 652 | } else if (role == SkipPager) { | ||
650 | return d->windowInfo(window)->hasState(NET::SkipPager); | 653 | return d->windowInfo(window)->hasState(NET::SkipPager); | ||
651 | } else if (role == AppPid) { | 654 | } else if (role == AppPid) { | ||
652 | return d->windowInfo(window)->pid(); | 655 | return d->windowInfo(window)->pid(); | ||
653 | } | 656 | } | ||
654 | 657 | | |||
655 | return QVariant(); | 658 | return QVariant(); | ||
656 | } | 659 | } | ||
▲ Show 20 Lines • Show All 412 Lines • Show Last 20 Lines |