Files
haikuports/games-action/bugdom/patches/bugdom-1.3.1-source2.patchset
2022-05-11 19:09:17 -06:00

42 lines
1.1 KiB
Plaintext

From 792f76994bf09c2199ab3dc9706fb47b50803c69 Mon Sep 17 00:00:00 2001
From: Ivan Holmes <ivan@ivanholmes.co.uk>
Date: Sat, 7 May 2022 00:34:04 +0100
Subject: Use Haiku user settings dir
diff --git a/src/Files/Files.cpp b/src/Files/Files.cpp
index fac01b7..7bd15f8 100644
--- a/src/Files/Files.cpp
+++ b/src/Files/Files.cpp
@@ -12,6 +12,9 @@
#if _WIN32
#include "Platform/Windows/PommeWindows.h"
+#elif defined(__HAIKU__)
+ #include <Path.h>
+ #include <FindDirectory.h>
#endif
using namespace Pomme;
@@ -179,6 +182,10 @@ OSErr FindFolder(short vRefNum, OSType folderType, Boolean createFolder, short*
return fnfErr;
}
path = fs::path(home) / "Library" / "Preferences";
+#elif defined(__HAIKU__)
+ BPath configBPath;
+ find_directory(B_USER_SETTINGS_DIRECTORY, &configBPath);
+ path = fs::path(configBPath.Path());
#else
const char* home = getenv("XDG_CONFIG_HOME");
if (home)
@@ -400,4 +407,4 @@ OSErr SetFPos(short refNum, short posMode, long filePos)
FSSpec Pomme::Files::HostPathToFSSpec(const fs::path& fullPath)
{
return dynamic_cast<HostVolume*>(volumes[0].get())->ToFSSpec(fullPath);
-}
\ No newline at end of file
+}
--
2.30.2