zeal: enable singleton code and 32 bit (#10442)

This allows query/url commands to be sent to a running instance.
Fixes #10441
This commit is contained in:
augiedoggie
2024-05-14 18:17:59 -06:00
committed by GitHub
parent da1bd9d4bc
commit 0f37c047c8
5 changed files with 6 additions and 237 deletions

View File

@@ -1,5 +1,5 @@
resource app_flags B_SINGLE_LAUNCH;
resource app_flags B_MULTIPLE_LAUNCH;
resource app_version {
major = @MAJOR@,

View File

@@ -1,100 +0,0 @@
From 70fbd5c99aa2027804533c238ed6d4a8a8229a12 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Mon, 3 Sep 2018 20:03:29 +1000
Subject: Fix build for Haiku
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 611ee1f..02a3d44 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -203,6 +203,7 @@ int main(int argc, char *argv[])
}
#endif
+#ifndef Q_OS_HAIKU
QScopedPointer<Core::ApplicationSingleton> appSingleton(new Core::ApplicationSingleton());
if (appSingleton->isSecondary()) {
#ifdef Q_OS_WIN32
@@ -215,7 +216,7 @@ int main(int argc, char *argv[])
appSingleton->sendMessage(ba);
return EXIT_SUCCESS;
}
-
+#endif
// Set application-wide window icon. All message boxes and other windows will use it by default.
qapp->setWindowIcon(QIcon::fromTheme(QStringLiteral("zeal"),
QIcon(QStringLiteral(":/zeal.ico"))));
@@ -223,7 +224,7 @@ int main(int argc, char *argv[])
QDir::setSearchPaths(QStringLiteral("typeIcon"), {QStringLiteral(":/icons/type")});
QScopedPointer<Core::Application> app(new Core::Application());
-
+#ifndef Q_OS_HAIKU
QObject::connect(appSingleton.data(), &Core::ApplicationSingleton::messageReceived,
[&app](const QByteArray &data) {
Registry::SearchQuery query;
@@ -234,7 +235,7 @@ int main(int argc, char *argv[])
app->executeQuery(query, preventActivation);
});
-
+#endif
if (!clParams.query.isEmpty()) {
QTimer::singleShot(0, [&app, clParams] {
app->executeQuery(clParams.query, clParams.preventActivation);
diff --git a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt
index 8b1b0ef..ce2c28a 100644
--- a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt
+++ b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt
@@ -6,6 +6,10 @@ if(APPLE)
list(APPEND QxtGlobalShortcut_SOURCES
qxtglobalshortcut_mac.cpp
)
+elseif(HAIKU)
+ list(APPEND QxtGlobalShortcut_SOURCES
+ qxtglobalshortcut_haiku.cpp
+ )
elseif(UNIX)
find_package(X11)
if(X11_FOUND)
diff --git a/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp
new file mode 100644
index 0000000..1bb9cde
--- /dev/null
+++ b/src/libs/ui/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp
@@ -0,0 +1,31 @@
+#include "qxtglobalshortcut_p.h"
+
+#include <QKeySequence>
+#include <QScopedPointer>
+#include <QVector>
+
+bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray &eventType,
+ void *message, long *result)
+{
+ return false;
+}
+
+quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers)
+{
+ return 0;
+}
+
+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
+{
+ return 0;
+}
+
+bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods)
+{
+ return false;
+}
+
+bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods)
+{
+ return false;
+}
--
2.16.4

View File

@@ -4,42 +4,6 @@ Date: Mon, 3 Sep 2018 20:03:29 +1000
Subject: Fix build for Haiku
diff --git a/src/app/main.cpp b/src/app/main.cpp
index 765bfe3..2072e7c 100644
--- a/src/app/main.cpp
+++ b/src/app/main.cpp
@@ -219,6 +219,7 @@ int main(int argc, char *argv[])
}
#endif
+#ifndef Q_OS_HAIKU
QScopedPointer<Core::ApplicationSingleton> appSingleton(new Core::ApplicationSingleton());
if (appSingleton->isSecondary()) {
#ifdef Q_OS_WIN32
@@ -231,6 +232,7 @@ int main(int argc, char *argv[])
appSingleton->sendMessage(ba);
return EXIT_SUCCESS;
}
+#endif
// Set application-wide window icon. All message boxes and other windows will use it by default.
qapp->setDesktopFileName(QStringLiteral("org.zealdocs.zeal"));
@@ -241,6 +243,7 @@ int main(int argc, char *argv[])
QScopedPointer<Core::Application> app(new Core::Application());
+#ifndef Q_OS_HAIKU
QObject::connect(appSingleton.data(), &Core::ApplicationSingleton::messageReceived,
[&app](const QByteArray &data) {
Registry::SearchQuery query;
@@ -251,6 +254,7 @@ int main(int argc, char *argv[])
app->executeQuery(query, preventActivation);
});
+#endif
if (!clParams.query.isEmpty()) {
QTimer::singleShot(0, app.data(), [&app, clParams] {
diff --git a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt b/src/libs/ui/qxtglobalshortcut/CMakeLists.txt
index f1c6a05..36660e4 100644
--- a/src/libs/ui/qxtglobalshortcut/CMakeLists.txt

View File

@@ -1,92 +0,0 @@
SUMMARY="A simple offline documentation browser inspired by Dash"
DESCRIPTION="Zeal is a cross-platform, open source, offline \
documentation browser for software developers, inspired by Dash Docs \
for macOS and iOS. Zeal has over 195+ docsets and are all compatible \
with Dash docsets."
HOMEPAGE="https://zealdocs.org/"
COPYRIGHT="2013-2018 Oleg Shparber"
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://github.com/zealdocs/zeal/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="095c08f9903071849d5c79878abd48237ce1615f16d324afff1873ab6b5f0026"
SOURCE_FILENAME="zeal-$portVersion.tar.gz"
PATCHES="zeal-$portVersion.patchset"
ADDITIONAL_FILES="zeal.rdef.in"
ARCHITECTURES="all !x86_gcc2 ?x86"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="x86"
fi
PROVIDES="
zeal$secondaryArchSuffix = $portVersion
app:Zeal = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libarchive$secondaryArchSuffix
lib:libGL$secondaryArchSuffix
lib:libQt5Core$secondaryArchSuffix
lib:libQt5Gui$secondaryArchSuffix
lib:libQt5Network$secondaryArchSuffix
lib:libQt5WebKit$secondaryArchSuffix
lib:libQt5WebKitWidgets$secondaryArchSuffix
lib:libsqlite3$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
extra_cmake_modules$secondaryArchSuffix
devel:libarchive$secondaryArchSuffix
devel:libQt5Core$secondaryArchSuffix
devel:libQt5Gui$secondaryArchSuffix
devel:libQt5Network$secondaryArchSuffix
devel:libQt5WebKit$secondaryArchSuffix
devel:libsqlite3$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:g++$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
mkdir -p build
cd build
cmake .. $cmakeDirArgs \
-DECM_DIR=/system/data/cmake/Modules/ECM/cmake
make $jobArgs
}
INSTALL()
{
mkdir -p $appsDir
cp build/bin/zeal $appsDir/Zeal
local APP_SIGNATURE="application/x-vnd.zeal"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"
local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
local MINOR="`echo "$portVersion" | cut -d. -f3`"
local LONG_INFO="$SUMMARY"
sed \
-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
-e "s|@MAJOR@|$MAJOR|" \
-e "s|@MIDDLE@|$MIDDLE|" \
-e "s|@MINOR@|$MINOR|" \
-e "s|@LONG_INFO@|$LONG_INFO|" \
$portDir/additional-files/zeal.rdef.in > zeal.rdef
addResourcesToBinaries zeal.rdef $appsDir/Zeal
mimeset -f $appsDir/Zeal
addAppDeskbarSymlink $appsDir/Zeal
}
TEST()
{
make test
}

View File

@@ -6,17 +6,14 @@ with Dash docsets."
HOMEPAGE="https://zealdocs.org/"
COPYRIGHT="2013-2023 Oleg Shparber and other contributors"
LICENSE="GNU GPL v3"
REVISION="1"
REVISION="2"
SOURCE_URI="https://github.com/zealdocs/zeal/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="937cbfe3ca49a7ee2d908baa3c5b008f425ae88cf2dade0abb2651b14f0f89ca"
SOURCE_FILENAME="zeal-$portVersion.tar.gz"
PATCHES="zeal-$portVersion.patchset"
ADDITIONAL_FILES="zeal.rdef.in"
ARCHITECTURES="all !x86_gcc2 ?x86"
if [ "$targetArchitecture" = x86_gcc2 ]; then
SECONDARY_ARCHITECTURES="?x86"
fi
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
zeal$secondaryArchSuffix = $portVersion
@@ -68,8 +65,8 @@ BUILD()
INSTALL()
{
mkdir -p $appsDir
cp build/zeal $appsDir/Zeal
mkdir -pv $appsDir
cp -afv build/zeal $appsDir/Zeal
local APP_SIGNATURE="application/x-vnd.zeal"
local MAJOR="`echo "$portVersion" | cut -d. -f1`"