Commit b473fed7 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

[kcms/plasmasearch] Enable Apply button when resetting to defaults

setConfig must be called before addPlugins, otherwise the model emits the wrong defaults state

We must call setNeedsSave when setting to defaults

We must connect defaulted to setRepresentsDefaults, not its getter
parent db0e1622
Pipeline #230078 passed with stage
in 5 minutes and 10 seconds
......@@ -55,7 +55,10 @@ SearchConfigModule::SearchConfigModule(QObject *parent, const KPluginMetaData &d
qDBusRegisterMetaType<QByteArrayList>();
qDBusRegisterMetaType<QHash<QString, QByteArrayList>>();
connect(m_model, &KPluginModel::defaulted, this, &SearchConfigModule::representsDefaults);
connect(m_model, &KPluginModel::defaulted, this, [this](bool isDefaults) {
setNeedsSave(m_model->isSaveNeeded());
setRepresentsDefaults(isDefaults);
});
connect(m_model, &KPluginModel::isSaveNeededChanged, this, [this]() {
setNeedsSave(m_model->isSaveNeeded());
});
......@@ -80,8 +83,8 @@ void SearchConfigModule::reloadPlugins()
{
m_model->clear();
m_model->addPlugins(Plasma::RunnerManager::runnerMetaDataList(), i18n("Available Plugins"));
m_model->setConfig(m_config->group("Plugins"));
m_model->addPlugins(Plasma::RunnerManager::runnerMetaDataList(), i18n("Available Plugins"));
}
void SearchConfigModule::showKCM(const KPluginMetaData &data, const QStringList args) const
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment