Small fix

This commit is contained in:
Chris Bordeman 2024-10-15 00:13:40 -04:00
parent 7af8d8aa70
commit 9da2a44eff
2 changed files with 9 additions and 8 deletions

View File

@ -7,6 +7,7 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Serilog;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
@ -406,6 +407,12 @@ namespace AppScaffolding
}
}
class FilterState_6_6_9
{
public bool UseDefault { get; set; }
public List<string> Filters { get; set; } = new();
}
public static void migrate_to_v11_5_0(Configuration config)
{
// Read file, but convert old format to new (with Name field) as necessary.
@ -431,8 +438,8 @@ namespace AppScaffolding
try
{
if (JsonConvert.DeserializeObject<QuickFilters.OldFilterState>(File.ReadAllText(QuickFilters.JsonFile))
is QuickFilters.OldFilterState inMemState)
if (JsonConvert.DeserializeObject<FilterState_6_6_9>(File.ReadAllText(QuickFilters.JsonFile))
is FilterState_6_6_9 inMemState)
{
// Copy old structure to new.
QuickFilters.InMemoryState = new();

View File

@ -14,12 +14,6 @@ namespace LibationFileManager
public static event EventHandler? UseDefaultChanged;
public class OldFilterState
{
public bool UseDefault { get; set; }
public List<string> Filters { get; set; } = new();
}
public class FilterState
{
public bool UseDefault { get; set; }