Fixed marshalling of the message so we now pass the status back

This commit is contained in:
Rob Emery 2024-10-05 19:30:55 +01:00 committed by Carl Schwan
parent 355c2e1ff8
commit 44e85d73df
No known key found for this signature in database
GPG key ID: 02325448204E452A

View file

@ -12,6 +12,7 @@
#include <KLocalizedString> #include <KLocalizedString>
#include <KPluginFactory> #include <KPluginFactory>
#include <KPluginMetaData> #include <KPluginMetaData>
#include <QMessageBox>
#include <QtWidgets/QListView> #include <QtWidgets/QListView>
#include <kcmutils_version.h> #include <kcmutils_version.h>
@ -184,16 +185,18 @@ KdeConnectKcm::~KdeConnectKcm()
void KdeConnectKcm::refresh() void KdeConnectKcm::refresh()
{ {
QStringList providerStatus; QStringList providerStatusToSend;
for (int i = 0; i < kcmUi.linkProviders_list->count(); ++i) { for (int i = 0; i < kcmUi.linkProviders_list->count(); ++i) {
QListWidgetItem *item = kcmUi.linkProviders_list->item(i); QListWidgetItem *item = kcmUi.linkProviders_list->item(i);
QString providerStatus = item->checkState() == Qt::Checked ? QStringLiteral("enabled") : QStringLiteral("disabled"); QString providerIsEnabled = item->checkState() == Qt::Checked ? QStringLiteral("enabled") : QStringLiteral("disabled");
QString line = item->text() + QStringLiteral("|") + providerStatus; QString line = item->text() + QStringLiteral("|") + providerIsEnabled;
providerStatus.append(line); providerStatusToSend.append(line);
// QMessageBox::information(widget(), QStringLiteral("thisLine"), line, QMessageBox::StandardButton::NoButton);
} }
daemon->setProviderStatus(providerStatus); // QMessageBox::information(widget(), QStringLiteral("ProviderStatus"),providerStatusToSend.join(QStringLiteral("")),
// QMessageBox::StandardButton::NoButton);
daemon->setProviderStatus(providerStatusToSend);
daemon->forceOnNetworkChange(); daemon->forceOnNetworkChange();
} }