From 6f51d6f75aa1718af0a0a78d342de02ba7fc6dd5 Mon Sep 17 00:00:00 2001 From: "Vadim A. Onuchin" Date: Wed, 24 Apr 2024 16:10:58 +0300 Subject: [PATCH] Alternative path for save settings Some users with not good skills may not found folder with setting when delete installation Using ~/.source-git folder can reduce difficult for delete settings --- src/App.axaml.cs | 4 ++-- src/Models/AvatarManager.cs | 2 +- src/ViewModels/Preference.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/App.axaml.cs b/src/App.axaml.cs index eeacb56d..741b9829 100644 --- a/src/App.axaml.cs +++ b/src/App.axaml.cs @@ -43,8 +43,8 @@ namespace SourceGit builder.Append(ex.StackTrace); var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); - var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), - "SourceGit", + var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".source-git", $"crash_{time}.log"); File.WriteAllText(file, builder.ToString()); } diff --git a/src/Models/AvatarManager.cs b/src/Models/AvatarManager.cs index fded94e3..2227abf9 100644 --- a/src/Models/AvatarManager.cs +++ b/src/Models/AvatarManager.cs @@ -25,7 +25,7 @@ namespace SourceGit.Models static AvatarManager() { - _storePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SourceGit", "avatars"); + _storePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".source-git", "avatars"); if (!Directory.Exists(_storePath)) Directory.CreateDirectory(_storePath); diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 8d0520c8..85b42f33 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -435,8 +435,8 @@ namespace SourceGit.ViewModels private static Preference _instance = null; private static readonly string _savePath = Path.Combine( - Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), - "SourceGit", + Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), + ".source-git", "preference.json"); private string _locale = "en_US";