From 04d655bf968bdf7043d32b430e8226f9dffc35ba Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 19 Apr 2020 11:40:52 +1000
Subject: Fix settings dir


diff --git a/src/libaudcore/runtime.cc b/src/libaudcore/runtime.cc
index 062cc59..3a9d918 100644
--- a/src/libaudcore/runtime.cc
+++ b/src/libaudcore/runtime.cc
@@ -34,6 +34,9 @@
 #ifdef __APPLE__
 #include <mach-o/dyld.h>
 #endif
+#ifdef __HAIKU__
+#include <FindDirectory.h>
+#endif
 
 #include <glib.h>
 #include <libintl.h>
@@ -232,6 +235,13 @@ static void set_install_paths()
 static void set_config_paths()
 {
     const char * xdg_config_home = g_get_user_config_dir();
+#ifdef __HAIKU__
+	char audaciousSettings[PATH_MAX] = "";
+	if (find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, audaciousSettings, sizeof(audaciousSettings)) == B_OK) {
+		strcat(audaciousSettings, "/Audacious");
+		xdg_config_home = audaciousSettings;
+	}
+#endif
     StringBuf name = (instance_number == 1)
                          ? str_copy("audacious")
                          : str_printf("audacious-%d", instance_number);
-- 
2.26.0

