From 42ce4764d2e7a42108a8cd9dbeddb674a25b4770 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Tue, 9 Jan 2024 23:14:26 +0100 Subject: [PATCH] [app] Fix plugin list Filter out not loaded plugins Fix loading the plugin components --- app/qml/DevicePage.qml | 19 +++++++++---------- app/qml/PluginItem.qml | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/app/qml/DevicePage.qml b/app/qml/DevicePage.qml index 815384296..e33265a3e 100644 --- a/app/qml/DevicePage.qml +++ b/app/qml/DevicePage.qml @@ -46,36 +46,35 @@ Kirigami.ScrollablePage { ] ListView { - model: plugins + model: plugins.filter((plugin) => plugin.loaded) delegate: QQC2.ItemDelegate { - text: name - icon.name: iconName + text: modelData.name + icon.name: modelData.iconName highlighted: false icon.color: "transparent" width: ListView.view.width - visible: loaded - onClicked: onClick() + onClicked: modelData.onClick() } property list plugins: [ PluginItem { name: i18nd("kdeconnect-app", "Multimedia control") interfaceFactory: MprisDbusInterfaceFactory - component: "qrc:/qml/mpris.qml" + component: "mpris.qml" pluginName: "mprisremote" device: root.currentDevice }, PluginItem { name: i18nd("kdeconnect-app", "Remote input") interfaceFactory: RemoteControlDbusInterfaceFactory - component: "qrc:/qml/mousepad.qml" + component: "mousepad.qml" pluginName: "remotecontrol" device: root.currentDevice }, PluginItem { name: i18nd("kdeconnect-app", "Presentation Remote") interfaceFactory: RemoteKeyboardDbusInterfaceFactory - component: "qrc:/qml/presentationRemote.qml" + component: "presentationRemote.qml" pluginName: "remotecontrol" device: root.currentDevice }, @@ -96,7 +95,7 @@ Kirigami.ScrollablePage { PluginItem { name: i18nd("kdeconnect-app", "Run command") interfaceFactory: RemoteCommandsDbusInterfaceFactory - component: "qrc:/qml/runcommand.qml" + component: "runcommand.qml" pluginName: "remotecommands" device: root.currentDevice }, @@ -116,7 +115,7 @@ Kirigami.ScrollablePage { PluginItem { name: i18nd("kdeconnect-app", "Volume control") interfaceFactory: RemoteSystemVolumeDbusInterfaceFactory - component: "qrc:/qml/volume.qml" + component: "volume.qml" pluginName: "remotesystemvolume" device: root.currentDevice } diff --git a/app/qml/PluginItem.qml b/app/qml/PluginItem.qml index 127a8656b..b3db42d42 100644 --- a/app/qml/PluginItem.qml +++ b/app/qml/PluginItem.qml @@ -29,7 +29,7 @@ QtObject var obj = interfaceFactory.create(checker.device.id()); var page = pageStack.push( - component, + Qt.resolvedUrl(component), { pluginInterface: obj, device: checker.device }