mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-18 09:40:05 +02:00
45 lines
1.4 KiB
Plaintext
45 lines
1.4 KiB
Plaintext
From f67abf36fc26fcc9e86c16fef5ef86c89f995378 Mon Sep 17 00:00:00 2001
|
|
From: Bach Nguyen <bach5000@gci.test>
|
|
Date: Tue, 26 Dec 2017 21:45:17 +0000
|
|
Subject: Fix settings dir
|
|
|
|
|
|
diff --git a/src-QT4/kreplacements/kreplacements.cpp b/src-QT4/kreplacements/kreplacements.cpp
|
|
index 6564ae8..ebda855 100644
|
|
--- a/src-QT4/kreplacements/kreplacements.cpp
|
|
+++ b/src-QT4/kreplacements/kreplacements.cpp
|
|
@@ -48,6 +48,9 @@
|
|
#include <vector>
|
|
#include <algorithm>
|
|
|
|
+#if defined(__HAIKU__)
|
|
+#include <FindDirectory.h>
|
|
+#endif
|
|
|
|
static QString s_copyright;
|
|
static QString s_email;
|
|
@@ -419,12 +422,18 @@ QString KStandardDirs::findResource(const QString& resource, const QString& /*ap
|
|
{
|
|
#if defined(_WIN32) || defined(Q_OS_OS2)
|
|
QString exePath = QCoreApplication::applicationDirPath();
|
|
QString configPath = exePath + "/.kdiff3rc"; // This is useful for portable installations (e.g. on USB-Stick)
|
|
if ( QFile::exists( configPath ) )
|
|
return configPath;
|
|
+#elif defined(__HAIKU__)
|
|
+ char hdir[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH];
|
|
+ find_directory(B_USER_SETTINGS_DIRECTORY, -1, false, hdir, sizeof(hdir));
|
|
+ QString settings = hdir;
|
|
+ return settings + "/kdiff3rc";
|
|
+#else
|
|
+ QString home = QDir::homePath();
|
|
+ return home + "/.kdiff3rc";
|
|
#endif
|
|
- QString home = QDir::homePath();
|
|
- return home + "/.kdiff3rc";
|
|
}
|
|
return QString();
|
|
}
|
|
--
|
|
2.15.0
|
|
|