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
+16
View File
@@ -13,6 +13,11 @@ interface
function QtPlatformAllowsOpenGLControls: Boolean;
function HasOpenGLSpectrumSwitch: Boolean;
function CurrentScreenDPI: Integer;
// Возвращает каталог для хранения конфигурации (с завершающим разделителем).
// macOS: ~/Library/Application Support/ewsdr/
// Linux: ~/.config/ewsdr/
// Windows: каталог исполняемого файла
function GetAppCfgDir: string;
implementation
@@ -61,4 +66,15 @@ begin
if Result <= 0 then Result := 96;
end;
function GetAppCfgDir: string;
begin
{$IFDEF WINDOWS}
Result := IncludeTrailingPathDelimiter(ExtractFilePath(ParamStr(0)));
{$ELSE}
Result := IncludeTrailingPathDelimiter(GetAppConfigDir(False));
if not DirectoryExists(Result) then
ForceDirectories(Result);
{$ENDIF}
end;
end.