fix macOS build

This commit is contained in:
Uladzimir Karpenka
2026-05-28 15:59:49 +03:00
parent 4f281ce400
commit 4f127a30ad
8 changed files with 51 additions and 17 deletions
+6 -3
View File
@@ -6,7 +6,7 @@ unit Settings;
}
{$mode objfpc}{$H+}
interface
uses SysUtils, Classes, Math, fpJSON, jsonparser, jsonscanner;
uses SysUtils, Classes, Math, fpJSON, jsonparser, jsonscanner, PlatformUtils;
const
SETTINGS_FILE = 'hpsdr_settings.json';
@@ -268,7 +268,7 @@ type
procedure JW(O: TJSONObject; const K: string; V: Boolean); overload;
procedure JWS(O: TJSONObject; const K: string; const V: string);
public
constructor Create(const FilePath: string = SETTINGS_FILE);
constructor Create(const FilePath: string = '');
destructor Destroy; override;
procedure Load;
procedure Save;
@@ -428,7 +428,10 @@ end;
constructor TSettingsManager.Create(const FilePath: string);
begin
inherited Create;
FFilePath := FilePath;
if FilePath = '' then
FFilePath := GetAppCfgDir + SETTINGS_FILE
else
FFilePath := FilePath;
FRoot := TJSONObject.Create;
end;