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

Faces: Do not write resolved sensors to preset file

The three sensor properties of FaceController contain the resolved
sensors. This means we are not writing group regular expressions to face
presets but are wiriting only the local sensors that were found for that
group, pretty much bypassing why we have the groups in the first place.
The unresolved sensors are only contained in the sensor configuration,
so read them from there and write that to the preset faceproperties.


(cherry picked from commit 1ea0671d)
parent b94b0e11
Pipeline #174664 passed with stage
in 1 minute and 19 seconds
......@@ -942,9 +942,14 @@ void SensorFaceController::savePreset()
KConfig faceConfig(subDir.path() % QStringLiteral("/contents/config/faceproperties"));
KConfigGroup configGroup(&faceConfig, "Config");
configGroup.writeEntry(QStringLiteral("totalSensors"), QJsonDocument(totalSensors()).toJson(QJsonDocument::Compact));
configGroup.writeEntry(QStringLiteral("highPrioritySensorIds"), QJsonDocument(highPrioritySensorIds()).toJson(QJsonDocument::Compact));
configGroup.writeEntry(QStringLiteral("lowPrioritySensorIds"), QJsonDocument(lowPrioritySensorIds()).toJson(QJsonDocument::Compact));
auto sensors = d->readAndUpdateSensors(d->sensorsGroup, QStringLiteral("totalSensors"));
configGroup.writeEntry(QStringLiteral("totalSensors"), QJsonDocument(sensors).toJson(QJsonDocument::Compact));
sensors = d->readAndUpdateSensors(d->sensorsGroup, QStringLiteral("highPrioritySensorIds"));
configGroup.writeEntry(QStringLiteral("highPrioritySensorIds"), QJsonDocument(sensors).toJson(QJsonDocument::Compact));
sensors = d->readAndUpdateSensors(d->sensorsGroup, QStringLiteral("lowPrioritySensorIds"));
configGroup.writeEntry(QStringLiteral("lowPrioritySensorIds"), QJsonDocument(sensors).toJson(QJsonDocument::Compact));
configGroup.writeEntry(QStringLiteral("chartFace"), faceId());
KConfigGroup colorsGroup(&faceConfig, "SensorColors");
d->colorsGroup.copyTo(&colorsGroup);
......
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