Port to KSortFilterProxyModel

port away from the PlasmaCore version

see https://invent.kde.org/frameworks/plasma-framework/-/issues/19
This commit is contained in:
Marco Martin 2023-08-29 14:30:12 +00:00
parent 8db5df3ce9
commit 908029d4a6
4 changed files with 9 additions and 5 deletions

View file

@ -9,6 +9,7 @@ Dependencies:
'frameworks/kcoreaddons': '@latest-kf6' 'frameworks/kcoreaddons': '@latest-kf6'
'frameworks/ki18n': '@latest-kf6' 'frameworks/ki18n': '@latest-kf6'
'frameworks/kio': '@latest-kf6' 'frameworks/kio': '@latest-kf6'
'frameworks/kitemmodels': '@latest-kf6'
'frameworks/knotifications': '@latest-kf6' 'frameworks/knotifications': '@latest-kf6'
'frameworks/kpackage': '@latest-kf6' 'frameworks/kpackage': '@latest-kf6'
'frameworks/kservice': '@latest-kf6' 'frameworks/kservice': '@latest-kf6'

View file

@ -60,6 +60,7 @@ find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
DBusAddons DBusAddons
Plasma Plasma
PlasmaQuick PlasmaQuick
ItemModels
Service Service
Notifications Notifications
Wayland Wayland

View file

@ -17,6 +17,7 @@ import org.kde.kirigami as Kirigami
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.plasma5support 2.0 as P5Support import org.kde.plasma.plasma5support 2.0 as P5Support
import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.components 3.0 as PlasmaComponents
import org.kde.kitemmodels as KItemModels
import "indicators" as Indicators import "indicators" as Indicators
import "../dataproviders" as DataProviders import "../dataproviders" as DataProviders
@ -144,9 +145,9 @@ Item {
// system tray // system tray
Repeater { Repeater {
id: statusNotifierRepeater id: statusNotifierRepeater
model: PlasmaCore.SortFilterModel { model: KItemModels.KSortFilterProxyModel {
id: filteredStatusNotifiers id: filteredStatusNotifiers
filterRole: "Title" filterRoleName: "Title"
sourceModel: P5Support.DataModel { sourceModel: P5Support.DataModel {
dataSource: statusNotifierSource ? statusNotifierSource : null dataSource: statusNotifierSource ? statusNotifierSource : null
} }

View file

@ -6,6 +6,7 @@ import QtQuick
import org.kde.plasma.core as PlasmaCore import org.kde.plasma.core as PlasmaCore
import org.kde.taskmanager as TaskManager import org.kde.taskmanager as TaskManager
import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin
import org.kde.kitemmodels as KItemModels
pragma Singleton pragma Singleton
@ -14,10 +15,10 @@ pragma Singleton
QtObject { QtObject {
readonly property bool showingWindow: __internal.count > 0 && !WindowPlugin.WindowUtil.isShowingDesktop readonly property bool showingWindow: __internal.count > 0 && !WindowPlugin.WindowUtil.isShowingDesktop
property var __internal: PlasmaCore.SortFilterModel { property var __internal: KItemModels.KSortFilterProxyModel {
id: visibleMaximizedWindowsModel id: visibleMaximizedWindowsModel
filterRole: 'IsMinimized' filterRoleName: 'IsMinimized'
filterRegExp: 'false' filterString: 'false'
sourceModel: TaskManager.TasksModel { sourceModel: TaskManager.TasksModel {
id: tasksModel id: tasksModel
filterByVirtualDesktop: true filterByVirtualDesktop: true