mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
[PTRun]Don't clear config data on upgrade (#30187)
* [PTRun] Implemented a new JSON storage method for PTRun settings files. * [PTRun] Removed uncessary parts. * [PTRun] Spell checks. * [PTRun] New JsonSerializerOptions added for information files. * [PTRun] Unnecessary null check is removed. * [PT Run] - ExtractFields function removed. - Creating instance is used instead of deserializing. * [PTRun] Build fix * [PTRun] Removed unncessary parts * [PTRun] CheckWithInformationFileToClear reversed. * [PTRun] Build fix. * [PTRun] Deserialization is used instead of key by key comparison. * [PTRun] Removed unncessary parts. * [PTRun] Removed unncessary parts. * [PTRun] Remove entry if query is null or empty.
This commit is contained in:
@@ -9,6 +9,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
@@ -1033,7 +1034,24 @@ namespace PowerLauncher.ViewModel
|
||||
{
|
||||
if (!_saved)
|
||||
{
|
||||
if (_historyItemsStorage.CheckVersionMismatch())
|
||||
{
|
||||
if (!_historyItemsStorage.TryLoadData())
|
||||
{
|
||||
_history.Update();
|
||||
}
|
||||
}
|
||||
|
||||
_historyItemsStorage.Save();
|
||||
|
||||
if (_userSelectedRecordStorage.CheckVersionMismatch())
|
||||
{
|
||||
if (!_userSelectedRecordStorage.TryLoadData())
|
||||
{
|
||||
_userSelectedRecord.Update();
|
||||
}
|
||||
}
|
||||
|
||||
_userSelectedRecordStorage.Save();
|
||||
|
||||
_saved = true;
|
||||
|
||||
Reference in New Issue
Block a user