diff --git a/kcm/src/kcm_kscreen.h b/kcm/src/kcm_kscreen.h --- a/kcm/src/kcm_kscreen.h +++ b/kcm/src/kcm_kscreen.h @@ -41,11 +41,13 @@ virtual void load(); virtual void save(); virtual void defaults(); + void changed(); private: void configReady(KScreen::ConfigOperation *op); Widget *mKScreenWidget; + bool m_blockChanges = false; }; diff --git a/kcm/src/kcm_kscreen.cpp b/kcm/src/kcm_kscreen.cpp --- a/kcm/src/kcm_kscreen.cpp +++ b/kcm/src/kcm_kscreen.cpp @@ -91,6 +91,13 @@ { } +void KCMKScreen::changed() +{ + if (!m_blockChanges) { + KCModule::changed(); + } +} + void KCMKScreen::save() { qDebug() << "Saving"; @@ -137,11 +144,18 @@ return; } + m_blockChanges = true; /* Store the current config, apply settings */ auto *op = new SetConfigOperation(config); /* Block until the operation is completed, otherwise KCMShell will terminate * before we get to execute the Operation */ op->exec(); + + QTimer::singleShot(1000, this, + [this] () { + m_blockChanges = false; + } + ); } void KCMKScreen::defaults()