[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:
gokcekantarci
2024-02-06 18:33:19 +03:00
committed by GitHub
parent 4426df671e
commit 1c7c100a42
7 changed files with 174 additions and 28 deletions

View File

@@ -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;