From 01897942a0000433e869d63ee669612e7e75e279 Mon Sep 17 00:00:00 2001 From: Rob Emery Date: Sat, 5 Oct 2024 10:19:33 +0100 Subject: [PATCH] Trying to get end-to-end of the link providers out so we can pass back lists --- kcm/kcm.cpp | 17 +++++++++++++++++ kcm/kcm.ui | 10 ++++++++++ 2 files changed, 27 insertions(+) diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp index 48b09a86b..86db0fd4b 100644 --- a/kcm/kcm.cpp +++ b/kcm/kcm.cpp @@ -92,6 +92,23 @@ KdeConnectKcm::KdeConnectKcm(QObject *parent, const KPluginMetaData &md, const Q } }, this); + + kcmUi.bluetoothEnabled_checkbox->setChecked(false); + + setWhenAvailable( + daemon->linkProviders(), + [this](bool error, const QStringList linkProviders) { + for (int i = 0; i < linkProviders.size(); ++i) { + QString linkProvider = QString(linkProviders.at(i).constData()); + qDebug() << "link provider: " << linkProvider; + + if (linkProvider == QStringLiteral("bluetooth")) { + kcmUi.bluetoothEnabled_checkbox->setChecked(true); + } + } + }, + this); + connect(daemon, &DaemonDbusInterface::announcedNameChanged, kcmUi.rename_edit, &QLineEdit::setText); connect(daemon, &DaemonDbusInterface::announcedNameChanged, kcmUi.rename_label, &QLabel::setText); setRenameMode(false); diff --git a/kcm/kcm.ui b/kcm/kcm.ui index b3e561de8..4e9616eea 100644 --- a/kcm/kcm.ui +++ b/kcm/kcm.ui @@ -121,6 +121,16 @@ + + + + Bluetooth Enabled + + + true + + +