Files
haikuports/app-editors/wordtsar/patches/wordtsar-0.3.719.patchset
2023-06-17 20:20:14 -06:00

96 lines
2.0 KiB
Plaintext

From e8be41e9218cface01b51f6f404230b3fc14f830 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sat, 17 Jun 2023 19:13:03 -0600
Subject: move settings directory for Haiku
diff --git a/src/wordtsar.cpp b/src/wordtsar.cpp
index a94af80..1f85edf 100644
--- a/src/wordtsar.cpp
+++ b/src/wordtsar.cpp
@@ -26,6 +26,11 @@
#include <QVBoxLayout>
#include <QFont>
+#if defined(__HAIKU__)
+#include <FindDirectory.h>
+#include <Path.h>
+#endif
+
#include "src/wordtsar.h"
#include "src/gui/editor/editorctrl.h"
@@ -779,12 +784,29 @@ void cWordTsar::StatusOff(int index, QString text, wxClientDC &dc)
*/
+
void cWordTsar::ReadConfig(void)
{
CSimpleIniA ini ;
- QString dir = QDir::homePath() ;
+ QString dir;
+
+#if defined(__HAIKU__)
+ BPath path ;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK)
+ {
+ dir = path.Path() ;
+ dir += "/WordTsar" ;
+ }
+ else
+ {
+ dir = QDir::homePath() ;
+ dir += "/.WordTsar" ;
+ }
+#else
+ dir = QDir::homePath() ;
dir += "/.WordTsar" ;
+#endif
if(ini.LoadFile(dir.toUtf8().constData()) >= 0)
{
@@ -945,8 +967,24 @@ void cWordTsar::WriteConfig(void)
{
CSimpleIniA ini ;
- QString dir = QDir::homePath() ;
+ QString dir ;
+
+#if defined(__HAIKU__)
+ BPath path ;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &path) == B_OK)
+ {
+ dir = path.Path() ;
+ dir += "/WordTsar" ;
+ }
+ else
+ {
+ dir = QDir::homePath() ;
+ dir += "/.WordTsar" ;
+ }
+#else
+ dir = QDir::homePath() ;
dir += "/.WordTsar" ;
+#endif
// if(ini.LoadFile(dir.char_str()) >= 0)
ini.LoadFile(dir.toUtf8().constData()) ;
diff --git a/wordtsar.pro b/wordtsar.pro
index 9fe36a5..67da030 100644
--- a/wordtsar.pro
+++ b/wordtsar.pro
@@ -42,6 +42,8 @@ equals(DO_TEST, 1){
}
+haiku:LIBS += -lbe
+
unix:!macx {
CONFIG(release, debug|release){
versionTarget.target = ../src/core/include/version.h
--
2.39.2