Using string serialisation to workaround the weird build failure if
I make the return type anything more complex
This commit is contained in:
parent
cc2dc39f92
commit
e97461937c
2 changed files with 23 additions and 34 deletions
|
@ -149,20 +149,14 @@ QSet<LinkProvider *> Daemon::getLinkProviders() const
|
|||
|
||||
QStringList Daemon::linkProviders() const
|
||||
{
|
||||
/*
|
||||
QString allStr = QStringLiteral("all");
|
||||
QString enabledStr = QStringLiteral("enabled");
|
||||
|
||||
QMap<QString, QString> returnValue;
|
||||
QStringList returnValue;
|
||||
|
||||
for (LinkProvider *a : std::as_const(d->m_linkProviders)) {
|
||||
returnValue[allStr] += a->name();
|
||||
|
||||
// TODO add filtering by enabled config
|
||||
returnValue[enabledStr] += a->name();
|
||||
QString line = QString(a->name());
|
||||
line += QStringLiteral("|enabled");
|
||||
returnValue.append(line);
|
||||
}
|
||||
return returnValue;*/
|
||||
return QStringList();
|
||||
return returnValue;
|
||||
}
|
||||
QStringList Daemon::devices(bool onlyReachable, bool onlyTrusted) const
|
||||
{
|
||||
|
|
39
kcm/kcm.cpp
39
kcm/kcm.cpp
|
@ -93,32 +93,27 @@ KdeConnectKcm::KdeConnectKcm(QObject *parent, const KPluginMetaData &md, const Q
|
|||
}
|
||||
},
|
||||
this);
|
||||
/*
|
||||
|
||||
setWhenAvailable(
|
||||
daemon->linkProviders(),
|
||||
[this](bool error, const QStringList linkProviders) {
|
||||
for (int i = 0; i < linkProviders[QStringLiteral("all")].size(); ++i) {
|
||||
QString linkProvider = QString(linkProviders[QStringLiteral("all")].at(i).constData());
|
||||
QListWidgetItem linkProviderItem = new QListWidgetItem(linkProvider, kcmUi.linkProviders_list);
|
||||
linkProviderItem->setCheckState(Qt::Unchecked);
|
||||
if(linkProviders[QStringLiteral("enabled")].contains(linkProvider)){
|
||||
linkProviderItem->setCheckState(Qt::Checked);
|
||||
}
|
||||
kcmUi.linkProviders_list->addItem(linkProviderItem);
|
||||
}
|
||||
},
|
||||
this);
|
||||
*/
|
||||
setWhenAvailable(
|
||||
daemon->linkProviders(),
|
||||
[this](bool error, const QStringList linkProviders) { /*
|
||||
for (int i = 0; i < linkProviders[QStringLiteral("all")].size(); ++i) {
|
||||
QString linkProvider = QString(linkProviders[QStringLiteral("all")].at(i).constData());
|
||||
QListWidgetItem *linkProviderItem = new QListWidgetItem(linkProvider, kcmUi.linkProviders_list);
|
||||
linkProviderItem->setCheckState(Qt::Checked);
|
||||
kcmUi.linkProviders_list->addItem(linkProviderItem);
|
||||
}*/
|
||||
kcmUi.linkProviders_list->clear();
|
||||
for (int i = 0; i < linkProviders.size(); ++i) {
|
||||
QStringList linkProvider = linkProviders.at(i).split(QStringLiteral("|"));
|
||||
|
||||
QString providerName = linkProvider.at(0);
|
||||
QString providerStatus = linkProvider.at(1);
|
||||
|
||||
QListWidgetItem *linkProviderItem = new QListWidgetItem(providerName, kcmUi.linkProviders_list);
|
||||
|
||||
if (providerStatus.compare(QStringLiteral("enabled")) == 0) {
|
||||
linkProviderItem->setCheckState(Qt::Checked);
|
||||
} else {
|
||||
linkProviderItem->setCheckState(Qt::Unchecked);
|
||||
}
|
||||
|
||||
kcmUi.linkProviders_list->addItem(linkProviderItem);
|
||||
}
|
||||
},
|
||||
this);
|
||||
|
||||
|
|
Loading…
Reference in a new issue