mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[FancyZones] Refactor/improve saving JSON files (#8947)
* Divide SaveFancyZonesData into two functions
* Removed unused function, continued refactoring
* Use SaveAppZoneHistory in some places
* Revert "Use SaveAppZoneHistory in some places"
This reverts commit 74a4a1e467.
* Only save files if the contents are about to be changed
* Restore FileWatcher
This commit is contained in:
@@ -553,11 +553,20 @@ void FancyZonesData::LoadFancyZonesData()
|
||||
void FancyZonesData::SaveFancyZonesData() const
|
||||
{
|
||||
std::scoped_lock lock{ dataLock };
|
||||
JSONHelpers::SaveFancyZonesData(zonesSettingsFileName,
|
||||
appZoneHistoryFileName,
|
||||
deviceInfoMap,
|
||||
customZoneSetsMap,
|
||||
appZoneHistoryMap);
|
||||
JSONHelpers::SaveZoneSettings(zonesSettingsFileName, deviceInfoMap, customZoneSetsMap);
|
||||
JSONHelpers::SaveAppZoneHistory(appZoneHistoryFileName, appZoneHistoryMap);
|
||||
}
|
||||
|
||||
void FancyZonesData::SaveZoneSettings() const
|
||||
{
|
||||
std::scoped_lock lock{ dataLock };
|
||||
JSONHelpers::SaveZoneSettings(zonesSettingsFileName, deviceInfoMap, customZoneSetsMap);
|
||||
}
|
||||
|
||||
void FancyZonesData::SaveAppZoneHistory() const
|
||||
{
|
||||
std::scoped_lock lock{ dataLock };
|
||||
JSONHelpers::SaveAppZoneHistory(appZoneHistoryFileName, appZoneHistoryMap);
|
||||
}
|
||||
|
||||
void FancyZonesData::RemoveDesktopAppZoneHistory(const std::wstring& desktopId)
|
||||
|
||||
Reference in New Issue
Block a user