diff --git a/app/qml/Settings.qml b/app/qml/Settings.qml index 9012b925b..e9c8a86aa 100644 --- a/app/qml/Settings.qml +++ b/app/qml/Settings.qml @@ -29,6 +29,44 @@ FormCard.FormCardPage { } } + FormCard.FormHeader { + title: i18nc("@title:group", "Backends") + } + + FormCard.FormCard { + DBusProperty { + id: linkProvidersProperty + object: DaemonDbusInterface + read: "linkProviders" + defaultValue: [] + } + + Repeater { + model: linkProvidersProperty.value + + FormCard.FormCheckDelegate { + required property string modelData + + readonly property string linkProviderId: modelData.split('|')[0] + readonly property string displayName: switch (linkProviderId) { + case 'BluetoothLinkProvider': + return i18nc("@info KDE Connect provider name", "Bluetooth") + case 'LoopbackLinkProvider': + return i18nc("@info KDE Connect provider name", "Loopback") + case 'LanLinkProvider': + return i18nc("@info KDE Connect provider name", "WiFi Network") + } + + checked: modelData.split('|')[1] === 'enabled' + text: displayName + + onCheckedChanged: { + DaemonDbusInterface.setLinkProviderState(linkProviderId, checked); + } + } + } + } + FormCard.FormCard { Layout.topMargin: Kirigami.Units.gridUnit diff --git a/declarativeplugin/responsewaiter.cpp b/declarativeplugin/responsewaiter.cpp index 84d1b2349..555d050ae 100644 --- a/declarativeplugin/responsewaiter.cpp +++ b/declarativeplugin/responsewaiter.cpp @@ -33,7 +33,8 @@ DBusResponseWaiter::DBusResponseWaiter() m_registered << qRegisterMetaType>("QDBusPendingReply<>") << qRegisterMetaType>("QDBusPendingReply") << qRegisterMetaType>("QDBusPendingReply") << qRegisterMetaType>("QDBusPendingReply") - << qRegisterMetaType>("QDBusPendingReply"); + << qRegisterMetaType>("QDBusPendingReply") + << qRegisterMetaType>("QDBusPendingReply"); } QVariant DBusResponseWaiter::waitForReply(QVariant variant) const @@ -73,6 +74,8 @@ void DBusAsyncResponse::setPendingCall(QVariant variant) connect(watcher, &QDBusPendingCallWatcher::finished, watcher, &QObject::deleteLater); connect(&m_timeout, &QTimer::timeout, watcher, &QObject::deleteLater); m_timeout.start(); + } else { + qWarning() << "error: extractPendingCall didn't work"; } }