mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-04 22:18:55 +02:00
Kdiff3: fix settings/config directory :) (#1970)
* Create kdiff3-0.9.98.patchset
This commit is contained in:
committed by
Scott McCreary
parent
d1867bc1b9
commit
bd6acf95a4
44
kde-misc/kdiff3/patches/kdiff3-0.9.98.patchset
Normal file
44
kde-misc/kdiff3/patches/kdiff3-0.9.98.patchset
Normal file
@@ -0,0 +1,44 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user