diff --git a/kcms/ksplash/kcm.h b/kcms/ksplash/kcm.h --- a/kcms/ksplash/kcm.h +++ b/kcms/ksplash/kcm.h @@ -22,12 +22,12 @@ #define _KCM_SEARCH_H #include -#include +#include class QStandardItemModel; class SplashScreenSettings; -class KCMSplashScreen : public KQuickAddons::ConfigModule +class KCMSplashScreen : public KQuickAddons::ManagedConfigModule { Q_OBJECT Q_PROPERTY(SplashScreenSettings *splashScreenSettings READ splashScreenSettings CONSTANT) @@ -51,9 +51,7 @@ public Q_SLOTS: void getNewClicked(); - void load() override; void save() override; - void defaults() override; void test(const QString &plugin); Q_SIGNALS: diff --git a/kcms/ksplash/kcm.cpp b/kcms/ksplash/kcm.cpp --- a/kcms/ksplash/kcm.cpp +++ b/kcms/ksplash/kcm.cpp @@ -39,13 +39,10 @@ K_PLUGIN_FACTORY_WITH_JSON(KCMSplashScreenFactory, "kcm_splashscreen.json", registerPlugin();) KCMSplashScreen::KCMSplashScreen(QObject* parent, const QVariantList& args) - : KQuickAddons::ConfigModule(parent, args) + : KQuickAddons::ManagedConfigModule(parent, args) , m_settings(new SplashScreenSettings(this)) , m_model(new QStandardItemModel(this)) { - connect(m_settings, &SplashScreenSettings::engineChanged, this, [this]{ setNeedsSave(true); }); - connect(m_settings, &SplashScreenSettings::themeChanged, this, [this]{ setNeedsSave(true); }); - qmlRegisterType(); qmlRegisterType(); @@ -133,22 +130,10 @@ emit m_settings->themeChanged(); } -void KCMSplashScreen::load() -{ - m_settings->load(); - setNeedsSave(false); -} - void KCMSplashScreen::save() { m_settings->setEngine(m_settings->theme() == QStringLiteral("None") ? QStringLiteral("none") : QStringLiteral("KSplashQML")); - m_settings->save(); -} - -void KCMSplashScreen::defaults() -{ - m_settings->setDefaults(); - setNeedsSave(m_settings->isSaveNeeded()); + ManagedConfigModule::save(); } int KCMSplashScreen::pluginIndex(const QString &pluginName) const