Wiring this up to send through, looks like the array is empty for some

reason that I'm not seeing at a glance at current
This commit is contained in:
Rob Emery 2024-10-05 17:40:41 +01:00 committed by Carl Schwan
parent e97461937c
commit 355c2e1ff8
No known key found for this signature in database
GPG key ID: 02325448204E452A
3 changed files with 22 additions and 0 deletions

View file

@ -158,6 +158,15 @@ QStringList Daemon::linkProviders() const
} }
return returnValue; return returnValue;
} }
void Daemon::setProviderStatus(const QStringList &providerStatus)
{
qCDebug(KDECONNECT_CORE) << "setProviderStatus called" << providerStatus;
for (const auto &i : providerStatus) {
qCDebug(KDECONNECT_CORE) << "setProviderstatus with: " << i;
}
}
QStringList Daemon::devices(bool onlyReachable, bool onlyTrusted) const QStringList Daemon::devices(bool onlyReachable, bool onlyTrusted) const
{ {
QStringList ret; QStringList ret;

View file

@ -64,7 +64,10 @@ public Q_SLOTS:
Q_SCRIPTABLE QMap<QString, QString> deviceNames(bool onlyReachable = false, bool onlyPaired = false) const; Q_SCRIPTABLE QMap<QString, QString> deviceNames(bool onlyReachable = false, bool onlyPaired = false) const;
Q_SCRIPTABLE QString deviceIdByName(const QString &name) const; Q_SCRIPTABLE QString deviceIdByName(const QString &name) const;
Q_SCRIPTABLE QStringList linkProviders() const; Q_SCRIPTABLE QStringList linkProviders() const;
Q_SCRIPTABLE void setProviderStatus(const QStringList &providerStatus);
Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) = 0; Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) = 0;
Q_SIGNALS: Q_SIGNALS:

View file

@ -184,6 +184,16 @@ KdeConnectKcm::~KdeConnectKcm()
void KdeConnectKcm::refresh() void KdeConnectKcm::refresh()
{ {
QStringList providerStatus;
for (int i = 0; i < kcmUi.linkProviders_list->count(); ++i) {
QListWidgetItem *item = kcmUi.linkProviders_list->item(i);
QString providerStatus = item->checkState() == Qt::Checked ? QStringLiteral("enabled") : QStringLiteral("disabled");
QString line = item->text() + QStringLiteral("|") + providerStatus;
providerStatus.append(line);
}
daemon->setProviderStatus(providerStatus);
daemon->forceOnNetworkChange(); daemon->forceOnNetworkChange();
} }