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

