Commit 0bbdfff2 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Force save the face configuration if the face asked for it

Apparently ConfigSkeletonLoader will sometimes skip saving even if there
are changes. So force it to save if the face has requested saving to be
forced on destruction.

BUG: 435782
parent bc8961b9
......@@ -389,15 +389,19 @@ SensorFaceController::SensorFaceController(KConfigGroup &config, QQmlEngine *eng
SensorFaceController::~SensorFaceController()
{
auto forceSave = d->faceProperties.readEntry(QStringLiteral("ForceSaveOnDestroy"), false);
if (!d->shouldSync && !forceSave) {
// If we should not sync automatically, clear all changes before we
// destroy the config objects, otherwise they will be written during
// destruction.
d->appearanceGroup.markAsClean();
d->colorsGroup.markAsClean();
if (d->faceConfigLoader && d->faceConfigLoader->isSaveNeeded()) {
d->faceConfigLoader->load();
if (!forceSave) {
if (!d->shouldSync) {
// If we should not sync automatically, clear all changes before we
// destroy the config objects, otherwise they will be written during
// destruction.
d->appearanceGroup.markAsClean();
d->colorsGroup.markAsClean();
if (d->faceConfigLoader && d->faceConfigLoader->isSaveNeeded()) {
d->faceConfigLoader->load();
}
}
} else {
d->faceConfigLoader->save();
}
}
......
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