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
This commit is contained in:
Vadim A. Onuchin 2024-04-24 16:10:58 +03:00
parent 7e4e339a0c
commit 6f51d6f75a
No known key found for this signature in database
GPG key ID: 97E9A135989F9DD2
3 changed files with 5 additions and 5 deletions

View file

@ -43,8 +43,8 @@ namespace SourceGit
builder.Append(ex.StackTrace); builder.Append(ex.StackTrace);
var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); var time = DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss");
var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), var file = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"SourceGit", ".source-git",
$"crash_{time}.log"); $"crash_{time}.log");
File.WriteAllText(file, builder.ToString()); File.WriteAllText(file, builder.ToString());
} }

View file

@ -25,7 +25,7 @@ namespace SourceGit.Models
static AvatarManager() 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)) if (!Directory.Exists(_storePath))
Directory.CreateDirectory(_storePath); Directory.CreateDirectory(_storePath);

View file

@ -435,8 +435,8 @@ namespace SourceGit.ViewModels
private static Preference _instance = null; private static Preference _instance = null;
private static readonly string _savePath = Path.Combine( private static readonly string _savePath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"SourceGit", ".source-git",
"preference.json"); "preference.json");
private string _locale = "en_US"; private string _locale = "en_US";