Skip to content

Commit

Permalink
Add extra comments to SettingsIo
Browse files Browse the repository at this point in the history
A bit of extra comments/documentation to clarify more of what my code here does lol. Primarily, I was looking for the section that handles resolving the redirect files
  • Loading branch information
JaykeBird committed Sep 9, 2023
1 parent 9ab375d commit beffc5c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions PathfinderJson/SettingsIo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ private static string LocateAppDataFolder()

return AppDataFolder;
}

/// <summary>
/// This method sets up all of the main directories, and also initializes the <see cref="SettingsDirectory"/> variable. This does NOT create the SettingsDirectory.
/// </summary>
Expand Down Expand Up @@ -132,6 +133,10 @@ public static void SetupBaseDirectories()
}
}

/// <summary>
/// This sets the value <see cref="SettingsDirectory"/>, by reading the standard settings directory and resolving the redirect file if needed.
/// </summary>
/// <param name="appDataFolder">The path to the JaykeBird programs AppData folder.</param>
static void SetSettingsDirectoryVariable(string appDataFolder)
{
// in comparison to FindLatestSettings(), this locates the directory that settings should be placed in
Expand Down Expand Up @@ -521,9 +526,9 @@ public static (string? dirPath, bool canRequestUpgrade) LocateLatestSettingsDire
{
// let's also use the current version's settings in this folder too
// (so, we'll write a new settings redirect file)
string currentnDir = Path.Combine(mainSettingsDir, App.VersionString);
string currentnDir = Path.Combine(mainSettingsDir, App.VersionString); // this is the standard settings directory
Directory.CreateDirectory(currentnDir);
File.WriteAllText(Path.Combine(currentnDir, Settings_Redirect_Filename), newDir, UTF8Encoding);
File.WriteAllText(Path.Combine(currentnDir, Settings_Redirect_Filename), newDir, UTF8Encoding); // writing redirect file
return (newDir, false);
}
}
Expand Down

0 comments on commit beffc5c

Please sign in to comment.