Files
haikuports/games-action/mightymike/patches/mightymike-3.0.1-source2.patchset
2022-05-12 08:26:05 +02:00

42 lines
1.1 KiB
Plaintext

From 4e23f1a2b31ade45ea713f174a8ccde7348a6c5d 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..a8e521f 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