Files
haikuports/app-editors/featherpad/patches/featherpad-1.5.1.patchset
2024-05-08 08:29:00 +02:00

142 lines
5.5 KiB
Plaintext

From 4b7e2bc530ade4a3cd193fb59e18423d1e88d2f2 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 7 Jan 2024 11:58:04 -0700
Subject: Use system icons by default on Haiku
diff --git a/featherpad/config.cpp b/featherpad/config.cpp
index b8fd6a4..48fdac4 100644
--- a/featherpad/config.cpp
+++ b/featherpad/config.cpp
@@ -65,7 +65,11 @@ Config::Config():
closeWithLastTab_ (false),
sharedSearchHistory_ (false),
disableMenubarAccel_ (false),
+#if defined(Q_OS_HAIKU)
+ sysIcons_ (true),
+#else
sysIcons_ (false),
+#endif
vLineDistance_ (-80),
tabPosition_ (0),
maxSHSize_ (2),
--
2.43.2
From b6d80caebf37027ba62450db952c9131a622b81f Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 7 Jan 2024 14:42:11 -0700
Subject: Add .recipe files to sh syntax highlighter
diff --git a/featherpad/syntax.cpp b/featherpad/syntax.cpp
index 762877c..cbc1b57 100644
--- a/featherpad/syntax.cpp
+++ b/featherpad/syntax.cpp
@@ -91,7 +91,8 @@ void FPwin::setProgLang (TextEdit *textEdit)
|| baseName == ".bash_aliases" || baseName == ".xprofile"
|| baseName == ".profile" || baseName == ".mkshrc"
|| baseName == ".zprofile" || baseName == ".zlogin"
- || baseName == ".zshrc" || baseName == ".zshenv")
+ || baseName == ".zshrc" || baseName == ".zshenv"
+ || fname.endsWith (".recipe"))
progLan = "sh";
else if (fname.endsWith (".rb"))
progLan = "ruby";
--
2.43.2
From 0baea21f981c7365cdd0f5c71eef92557164fea7 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Sun, 7 Jan 2024 19:34:26 -0700
Subject: Remove Haiku specific customizations to the data directories
These interfere with packaging layout by putting files in the top level when using haikuporter.
We'll use the standard 'featherpad' subdirectory.
diff --git a/featherpad/CMakeLists.txt b/featherpad/CMakeLists.txt
index 634630e..bb8de84 100644
--- a/featherpad/CMakeLists.txt
+++ b/featherpad/CMakeLists.txt
@@ -140,7 +140,7 @@ if(Qt6LinguistTools_FOUND)
qt6_add_translation(QM_FILES ${TS_FILES})
add_executable(featherpad ${featherpad_SRCS} ${featherpad_DBUS_SRCS} ${featherpad_RESOURCES} ${EXTRA_HEADERS} ${DESKTOP_FILE} ${QM_FILES})
if(HAIKU)
- install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/translations")
+ install(FILES ${QM_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/data/featherpad/translations")
elseif(APPLE)
SET_SOURCE_FILES_PROPERTIES(${QM_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/translations)
elseif(UNIX OR OS2)
@@ -171,9 +171,11 @@ endif()
# installation
if(HAIKU)
- install(TARGETS featherpad RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX})
- install(FILES ${HELP_FILE} DESTINATION "${CMAKE_INSTALL_PREFIX}/data")
- install(FILES ${HELP_TR_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/data")
+ set_target_properties(featherpad PROPERTIES OUTPUT_NAME FeatherPad)
+ install(TARGETS featherpad RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/apps)
+ install(FILES ${HELP_FILE} DESTINATION "${CMAKE_INSTALL_PREFIX}/data/featherpad")
+ # also install translated help files
+ install(FILES ${HELP_TR_FILES} DESTINATION "${CMAKE_INSTALL_PREFIX}/data/featherpad")
elseif(APPLE)
SET_TARGET_PROPERTIES(featherpad PROPERTIES RESOURCE ${HELP_FILE})
SET_TARGET_PROPERTIES(featherpad PROPERTIES RESOURCE ${HELP_TR_FILES})
diff --git a/featherpad/fpwin.cpp b/featherpad/fpwin.cpp
index 61d9e2c..e75a4ec 100644
--- a/featherpad/fpwin.cpp
+++ b/featherpad/fpwin.cpp
@@ -6235,9 +6235,7 @@ void FPwin::helpDoc()
if (!langs.isEmpty())
lang = langs.first().replace ('-', '_');
-#if defined (Q_OS_HAIKU)
- QString helpPath (QStringLiteral (DATADIR) + "/help_" + lang);
-#elif defined (Q_OS_MAC)
+#if defined (Q_OS_MAC)
QString helpPath (qApp->applicationDirPath() + QStringLiteral ("/../Resources/") + "/help_" + lang);
#else
QString helpPath (QStringLiteral (DATADIR) + "/featherpad/help_" + lang);
@@ -6246,9 +6244,7 @@ void FPwin::helpDoc()
if (!QFile::exists (helpPath) && !langs.isEmpty())
{
lang = langs.first().split (QLatin1Char ('_')).first();
-#if defined(Q_OS_HAIKU)
- helpPath = QStringLiteral (DATADIR) + "/help_" + lang;
-#elif defined(Q_OS_MAC)
+#if defined(Q_OS_MAC)
helpPath = qApp->applicationDirPath() + QStringLiteral ("/../Resources/") + "/help_" + lang;
#else
helpPath = QStringLiteral (DATADIR) + "/featherpad/help_" + lang;
@@ -6257,9 +6253,7 @@ void FPwin::helpDoc()
if (!QFile::exists (helpPath))
{
-#if defined(Q_OS_HAIKU)
- helpPath = QStringLiteral (DATADIR) + "/help";
-#elif defined(Q_OS_MAC)
+#if defined(Q_OS_MAC)
helpPath = qApp->applicationDirPath() + QStringLiteral ("/../Resources/") + "/help";
#else
helpPath = QStringLiteral (DATADIR) + "/featherpad/help";
diff --git a/featherpad/main.cpp b/featherpad/main.cpp
index e610dfe..d54a823 100644
--- a/featherpad/main.cpp
+++ b/featherpad/main.cpp
@@ -96,9 +96,7 @@ int main (int argc, char **argv)
}
QTranslator FPTranslator;
-#if defined(Q_OS_HAIKU)
- if (FPTranslator.load ("featherpad_" + lang, QStringLiteral (DATADIR) + "/../translations"))
-#elif defined(Q_OS_MAC)
+#if defined(Q_OS_MAC)
if (FPTranslator.load ("featherpad_" + lang, singleton.applicationDirPath() + QStringLiteral ("/../Resources/translations/")))
#else
if (FPTranslator.load ("featherpad_" + lang, QStringLiteral (DATADIR) + "/featherpad/translations"))
--
2.43.2