Config: Use Path.Combine() instead of GetAbsolutePath()

This commit is contained in:
2024-01-18 22:07:31 +01:00
parent 7d199282d0
commit 1d1398a9cd
2 changed files with 3 additions and 7 deletions

View File

@ -24,9 +24,9 @@ namespace Elwig.Helpers {
public void Read() {
var config = new ConfigurationBuilder().AddIniFile(FileName).Build();
DatabaseFile = Utils.GetAbsolutePath(config["database:file"] ?? "database.sqlite3", App.DataPath);
DatabaseFile = Path.Combine(App.DataPath, config["database:file"] ?? "database.sqlite3");
var log = config["database:log"];
DatabaseLog = log != null ? Utils.GetAbsolutePath(log, App.DataPath) : null;
DatabaseLog = log != null ? Path.Combine(App.DataPath, log) : null;
Branch = config["general:branch"];
Debug = trueValues.Contains(config["general:debug"]?.ToLower());
@ -35,7 +35,7 @@ namespace Elwig.Helpers {
Scales = ScaleList;
foreach (var s in scales) {
string? scaleLog = config[$"scale.{s}:log"];
if (scaleLog != null) scaleLog = Utils.GetAbsolutePath(scaleLog, App.DataPath);
if (scaleLog != null) scaleLog = Path.Combine(App.DataPath, scaleLog);
ScaleList.Add([
s, config[$"scale.{s}:type"], config[$"scale.{s}:model"], config[$"scale.{s}:connection"],
config[$"scale.{s}:empty"], config[$"scale.{s}:filling"], config[$"scale.{s}:limit"], scaleLog