Files
haikuports/games-action/bugdom/patches/bugdom-1.3.4-source2.patchset
2025-04-23 00:04:40 +10:00

35 lines
920 B
Plaintext

From 75d5582c109ef772719359d6585770781639af6d 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 301431e..c540aad 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;
@@ -182,6 +185,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)
--
2.48.1