Commit 895b9986 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Support disabling config sync in FaceController

In KSysGuardQML, the config group is part of the page configuration.
Since we now want to move page configuration to explicitly save instead
of autosaving, we need control over when syncs happen. So add a boolean
to indicate that we should sync the config, that defaults to true.
parent 325c7ec9
......@@ -169,6 +169,7 @@ public:
QJsonArray lowPrioritySensorIds;
QTimer *syncTimer;
bool shouldSync = true;
FacesModel *availableFacesModel = nullptr;
PresetsModel *availablePresetsModel = nullptr;
......@@ -270,6 +271,9 @@ SensorFaceController::SensorFaceController(KConfigGroup &config, QQmlEngine *eng
connect(d->syncTimer, &QTimer::timeout, this, [this]() {
if (!d->shouldSync) {
......@@ -739,4 +743,18 @@ void SensorFaceController::uninstallPreset(const QString &pluginId)
bool SensorFaceController::shouldSync() const
return d->shouldSync;
void SensorFaceController::setShouldSync(bool sync)
d->shouldSync = sync;
if (!d->shouldSync && d->syncTimer->isActive()) {
#include "moc_SensorFaceController.cpp"
......@@ -114,6 +114,9 @@ public:
Q_INVOKABLE void savePreset();
Q_INVOKABLE void uninstallPreset(const QString &pluginId);
bool shouldSync() const;
void setShouldSync(bool sync);
void faceIdChanged();
void titleChanged();
Markdown is supported
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