[app] Fix plugin list

Filter out not loaded plugins

Fix loading the plugin components
This commit is contained in:
Nicolas Fella 2024-01-09 23:14:26 +01:00
parent aa09d338ee
commit 42ce4764d2
2 changed files with 10 additions and 11 deletions

View file

@ -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<QtObject> 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
}

View file

@ -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
}