Persist app zone history in real time (#1257)

* save settings every time changes are performed
* settings are not saved on app exit
This commit is contained in:
Seraphima 2020-02-11 14:34:37 +03:00 committed by GitHub
parent a1d277e771
commit 79c625d737
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -136,8 +136,6 @@ private:
void Disable(bool const traceEvent)
{
if (m_app) {
const auto& fancyZonesData = JSONHelpers::FancyZonesDataInstance();
fancyZonesData.SaveFancyZonesData();
if (traceEvent)
{
Trace::FancyZones::EnableFancyZones(false);

View File

@ -207,6 +207,7 @@ namespace JSONHelpers
if (data.zoneSetUuid == zoneSetId && data.deviceId == deviceId)
{
appZoneHistoryMap.erase(processPath);
SaveFancyZonesData();
return true;
}
}
@ -224,6 +225,7 @@ namespace JSONHelpers
}
appZoneHistoryMap[processPath] = AppZoneHistoryData{ .zoneSetUuid = zoneSetId, .deviceId = deviceId, .zoneIndex = zoneIndex };
SaveFancyZonesData();
return true;
}
@ -538,6 +540,7 @@ namespace JSONHelpers
if (appliedZoneSetsMap.contains(std::wstring{ activeZoneSetId }))
{
deviceInfoMap[deviceId] = DeviceInfoData{ appliedZoneSetsMap.at(std::wstring{ activeZoneSetId }), static_cast<bool>(showSpacing), static_cast<int>(spacing), static_cast<int>(zoneCount) };
SaveFancyZonesData();
}
}