Update `OsuConfigManager` in line with `ConfigManager` logging changes

This commit is contained in:
Dean Herbert 2022-08-22 17:03:20 +09:00
parent 3fb3a18e68
commit c86a75aa5f
1 changed files with 8 additions and 13 deletions

View File

@ -4,10 +4,8 @@
#nullable disable
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using osu.Framework.Configuration;
using osu.Framework.Configuration.Tracking;
using osu.Framework.Extensions;
@ -31,6 +29,12 @@ namespace osu.Game.Configuration
[ExcludeFromDynamicCompile]
public class OsuConfigManager : IniConfigManager<OsuSetting>
{
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
protected override void InitialiseDefaults()
{
// UI/selection defaults
@ -172,12 +176,9 @@ protected override void InitialiseDefaults()
SetDefault(OsuSetting.LastProcessedMetadataId, -1);
}
public IDictionary<OsuSetting, string> GetLoggableState() =>
new Dictionary<OsuSetting, string>(ConfigStore.Where(kvp => !keyContainsPrivateInformation(kvp.Key)).ToDictionary(kvp => kvp.Key, kvp => kvp.Value.ToString()));
private static bool keyContainsPrivateInformation(OsuSetting argKey)
protected override bool CheckLookupContainsPrivateInformation(OsuSetting lookup)
{
switch (argKey)
switch (lookup)
{
case OsuSetting.Token:
return true;
@ -186,12 +187,6 @@ private static bool keyContainsPrivateInformation(OsuSetting argKey)
return false;
}
public OsuConfigManager(Storage storage)
: base(storage)
{
Migrate();
}
public void Migrate()
{
// arrives as 2020.123.0