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
@@ -8,7 +8,7 @@ unit ChannelStore;
interface
uses
SysUtils, Classes, Math, fpJSON, jsonparser, jsonscanner;
SysUtils, Classes, Math, fpJSON, jsonparser, jsonscanner, PlatformUtils;
const
CHANNELS_FILE = 'channels.json';
@@ -36,7 +36,7 @@ type
function JB(O: TJSONObject; const K: string; Def: Boolean): Boolean;
function JS(O: TJSONObject; const K: string; const Def: string): string;
public
constructor Create(const AFilePath: string = CHANNELS_FILE);
constructor Create(const AFilePath: string = '');
procedure Load;
procedure Save;
function Count: Integer;
@@ -69,7 +69,10 @@ end;
constructor TChannelStore.Create(const AFilePath: string);
begin
inherited Create;
FFilePath := AFilePath;
if AFilePath = '' then
FFilePath := GetAppCfgDir + CHANNELS_FILE
else
FFilePath := AFilePath;
SetLength(FChannels, 0);
end;