-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dooble: set translations path on start up
- Loading branch information
Showing
2 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
From 03ce595e89d5b6517c1c3d5dc3f23e00b435c174 Mon Sep 17 00:00:00 2001 | ||
From: Jerome Duval <jerome.duval@gmail.com> | ||
Date: Mon, 8 Jan 2024 17:28:24 +0100 | ||
Subject: Haiku: set translations path | ||
|
||
|
||
diff --git a/Source/dooble_main.cc b/Source/dooble_main.cc | ||
index 17e1252..0e968f2 100644 | ||
--- a/Source/dooble_main.cc | ||
+++ b/Source/dooble_main.cc | ||
@@ -45,6 +45,10 @@ extern "C" | ||
#if defined(Q_OS_MACOS) | ||
#include <sys/resource.h> | ||
#endif | ||
+#if defined(Q_OS_HAIKU) | ||
+#include<libgen.h> | ||
+#include<OS.h> | ||
+#endif | ||
} | ||
|
||
#ifdef Q_OS_MACOS | ||
@@ -93,6 +97,17 @@ int main(int argc, char *argv[]) | ||
qputenv("QT_ENABLE_REGEXP_JIT", "0"); | ||
qputenv("QV4_FORCE_INTERPRETER", "1"); | ||
|
||
+#if defined(Q_OS_HAIKU) | ||
+ char *binpath = realpath(argv[0], NULL); | ||
+ if (binpath != NULL) { | ||
+ char buffer[B_PATH_NAME_LENGTH + B_FILE_NAME_LENGTH]; | ||
+ strlcpy(buffer, dirname(binpath), sizeof(buffer)); | ||
+ strlcat(buffer, "/Translations", sizeof(buffer)); | ||
+ qputenv("DOOBLE_TRANSLATIONS_PATH", buffer); | ||
+ free(binpath); | ||
+ } | ||
+#endif | ||
+ | ||
QList<QUrl> urls; | ||
auto attach = false; | ||
auto full_screen = false; | ||
-- | ||
2.42.1 | ||
|