Browse Source

Set ModelsDirectory default in property

pull/5/head
Ionite 1 year ago
parent
commit
d4cdf76da6
No known key found for this signature in database
  1. 1
      StabilityMatrix/Helper/SettingsManager.cs
  2. 13
      StabilityMatrix/Models/Settings.cs

1
StabilityMatrix/Helper/SettingsManager.cs

@ -206,7 +206,6 @@ public class SettingsManager : ISettingsManager
{
Converters = { new JsonStringEnumConverter() }
})!;
Settings.SetDefaults();
}
private void SaveSettings()

13
StabilityMatrix/Models/Settings.cs

@ -20,18 +20,7 @@ public class Settings
public List<string>? PathExtensions { get; set; }
public string? WebApiHost { get; set; }
public string? WebApiPort { get; set; }
[NotNull]
public string? ModelsDirectory { get; set; }
/// <summary>
/// Sets default values for settings
/// </summary>
[MemberNotNull(nameof(ModelsDirectory))]
public void SetDefaults()
{
ModelsDirectory ??= Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StabilityMatrix", "Models");
}
public string ModelsDirectory { get; set; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "StabilityMatrix", "Models");
public InstalledPackage? GetActiveInstalledPackage()
{

Loading…
Cancel
Save