From f82d15ce1e0018b089dbc5fb1cfa4f3db82cbf5d Mon Sep 17 00:00:00 2001 From: Dmytrii Zavalnyi Date: Mon, 23 Jan 2023 18:31:44 +0100 Subject: [PATCH] SMS app shows devices with SMS capabilities only Replaced DevicesSortProxyModel with DevicesPluginFilterProxyModel with applied "kdeconnect_sms" filter for the devices list model. BUG: 410112 --- declarativeplugin/kdeconnectdeclarativeplugin.cpp | 2 ++ smsapp/qml/main.qml | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/declarativeplugin/kdeconnectdeclarativeplugin.cpp b/declarativeplugin/kdeconnectdeclarativeplugin.cpp index 9b933681b..ecfa016cc 100644 --- a/declarativeplugin/kdeconnectdeclarativeplugin.cpp +++ b/declarativeplugin/kdeconnectdeclarativeplugin.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "objectfactory.h" #include "responsewaiter.h" @@ -51,6 +52,7 @@ void KdeConnectDeclarativePlugin::registerTypes(const char *uri) qmlRegisterType(uri, 1, 0, "RemoteCommandsModel"); qmlRegisterType(uri, 1, 0, "DBusAsyncResponse"); qmlRegisterType(uri, 1, 0, "DevicesSortProxyModel"); + qmlRegisterType(uri, 1, 0, "DevicesPluginFilterProxyModel"); qmlRegisterType(uri, 1, 0, "RemoteSinksModel"); qmlRegisterType(uri, 1, 0, "PluginModel"); qmlRegisterType(uri, 1, 0, "KdeConnectPluginConfig"); diff --git a/smsapp/qml/main.qml b/smsapp/qml/main.qml index 91fd7fcff..d8d192c38 100644 --- a/smsapp/qml/main.qml +++ b/smsapp/qml/main.qml @@ -40,9 +40,9 @@ Kirigami.ApplicationWindow Instantiator { id: instantiator - model: DevicesSortProxyModel { + model: DevicesPluginFilterProxyModel { id: devicesModel - //TODO: make it possible to filter if they can do sms + pluginFilter: "kdeconnect_sms" sourceModel: DevicesModel { displayFilter: DevicesModel.Paired | DevicesModel.Reachable } }