From 3747ce02ab2135c9952d7bca72049c350b92e46d Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 5 Jun 2015 17:43:34 +0300
Subject: Disabling QtSingleApplication on Haiku


diff --git a/src/qtsingleapplication/qtsingleapplication.cpp b/src/qtsingleapplication/qtsingleapplication.cpp
index d0fb15d..fe60eb8 100644
--- a/src/qtsingleapplication/qtsingleapplication.cpp
+++ b/src/qtsingleapplication/qtsingleapplication.cpp
@@ -239,7 +239,11 @@ QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int
 
 bool QtSingleApplication::isRunning()
 {
+#ifdef Q_OS_HAIKU
+    return false;
+#else
     return peer->isClient();
+#endif
 }
 
 
@@ -258,7 +262,11 @@ bool QtSingleApplication::isRunning()
 */
 bool QtSingleApplication::sendMessage(const QString &message, int timeout)
 {
-    return peer->sendMessage(message, timeout);
+#ifdef Q_OS_HAIKU
+    return false;
+#else
+     return peer->sendMessage(message, timeout);
+#endif
 }
 
 
-- 
2.30.2


From f2514f4e89bc488589cfa2188f13e923cdd17c02 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sun, 31 Oct 2021 17:21:10 +0300
Subject: Correctly identify Haiku instead of Other OS


diff --git a/src/smplayer.cpp b/src/smplayer.cpp
index 9cf774d..02079b1 100644
--- a/src/smplayer.cpp
+++ b/src/smplayer.cpp
@@ -618,12 +618,16 @@ void SMPlayer::showInfo() {
 #else
 #ifdef Q_OS_FREEBSD
            .arg("FreeBSD")
+#else
+#ifdef Q_OS_HAIKU
+           .arg("Haiku")
 #else
            .arg("Another OS")
 #endif
 #endif
 #endif
 #endif
+#endif
 #endif
            ;
 
-- 
2.30.2


From 1d9aa9fb24d1fe96cbf9ae8e4d9a138d2f16e9a7 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 7 Jul 2017 18:58:29 +0300
Subject: Disable UPDATE_CHECKER and GLOBALSHORTCUTS


diff --git a/src/smplayer.pro b/src/smplayer.pro
index 273a0ef..23c0c93 100644
--- a/src/smplayer.pro
+++ b/src/smplayer.pro
@@ -25,13 +25,13 @@ DEFINES += MINIGUI
 DEFINES += MPCGUI
 DEFINES += SKINS
 DEFINES += MPRIS2
-DEFINES += UPDATE_CHECKER
+DEFINES -= UPDATE_CHECKER
 #DEFINES += CHECK_UPGRADED
 DEFINES += AUTO_SHUTDOWN_PC
 #DEFINES += CAPTURE_STREAM
 DEFINES += BOOKMARKS
 DEFINES += MOUSE_GESTURES
-DEFINES += GLOBALSHORTCUTS
+DEFINES -= GLOBALSHORTCUTS
 DEFINES += ADD_BLACKBORDERS_FS
 DEFINES += INITIAL_BLACKBORDERS
 DEFINES += CHROMECAST_SUPPORT
-- 
2.30.2


From 6ede56a20d29e3f95b31b82b9fed8f92fade915d Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 7 Jul 2017 19:00:30 +0300
Subject: Disable webserver


diff --git a/Makefile b/Makefile
index 571e611..a9f4f53 100644
--- a/Makefile
+++ b/Makefile
@@ -22,7 +22,7 @@ DEFS=DATA_PATH=\\\"$(DATA_PATH)\\\" \
      DOC_PATH=\\\"$(DOC_PATH)\\\" THEMES_PATH=\\\"$(THEMES_PATH)\\\" \
      SHORTCUTS_PATH=\\\"$(SHORTCUTS_PATH)\\\"
 
-all: src/smplayer webserver/simple_web_server
+all: src/smplayer #webserver/simple_web_server
 
 src/smplayer:
 	./get_svn_revision.sh
-- 
2.30.2


From 1bfd4e365af4093ead46c933a09b500e5ebdb461 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sun, 9 Jul 2017 16:06:00 +0300
Subject: Fix PATHS on Haiku


diff --git a/Makefile b/Makefile
index a9f4f53..31eca9b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,14 +1,14 @@
 
-PREFIX=/usr/local
+PREFIX=.
 #PREFIX=/tmp/smplayer
 
 CONF_PREFIX=$(PREFIX)
 
-DATA_PATH=$(PREFIX)/share/smplayer
-DOC_PATH=$(PREFIX)/share/doc/packages/smplayer
-TRANSLATION_PATH=$(PREFIX)/share/smplayer/translations
-THEMES_PATH=$(PREFIX)/share/smplayer/themes
-SHORTCUTS_PATH=$(PREFIX)/share/smplayer/shortcuts
+DATA_PATH=$(PREFIX)/data
+DOC_PATH=$(PREFIX)/documentation
+TRANSLATION_PATH=$(PREFIX)/translations
+THEMES_PATH=$(PREFIX)/themes
+SHORTCUTS_PATH=$(PREFIX)/shortcuts
 
 ICONS_DIR=$(PREFIX)/share/icons/hicolor/
 APPLNK_DIR=$(PREFIX)/share/applications/
-- 
2.30.2


From 6ff1fa2b6ad55ffb734bb2ab1fc96db0006406ee Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Sun, 9 Jul 2017 16:06:44 +0300
Subject: Use default style on Haiku


diff --git a/src/preferences.cpp b/src/preferences.cpp
index 1982776..9d9eeac 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -407,12 +407,14 @@ void Preferences::reset() {
 
 	resize_method = Never;
 
+#ifndef Q_OS_HAIKU
 #if STYLE_SWITCHING
 	#if QT_VERSION >= 0x050000
 	style = "Fusion";
 	#else
 	style="";
 	#endif
+#endif
 #endif
 
 	center_window = false;
-- 
2.30.2


From a31715d36af696d345befda9004197d5533ae251 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sun, 31 Oct 2021 17:28:21 +0300
Subject: Fix winId on Haiku


diff --git a/src/core.cpp b/src/core.cpp
index 71bb60c..5457f5e 100644
--- a/src/core.cpp
+++ b/src/core.cpp
@@ -1842,6 +1842,8 @@ void Core::startMplayer( QString file, double seek ) {
 		#ifdef Q_OS_OS2
 		#define WINIDFROMHWND(hwnd) ( ( hwnd ) - 0x80000000UL )
 		proc->setOption("wid", QString::number( WINIDFROMHWND( (int) mplayerwindow->videoLayer()->winId() ) ));
+		+#elif defined(Q_OS_HAIKU)
+		proc->setOption("wid", QString::number(0));
 		#else
 		#ifndef Q_OS_MACX
 		proc->setOption("wid", QString::number( (qint64) mplayerwindow->videoLayer()->winId() ) );
diff --git a/src/svn_revision.h b/src/svn_revision.h
index c8da1c5..3ffec4b 100644
--- a/src/svn_revision.h
+++ b/src/svn_revision.h
@@ -1 +1 @@
-#define SVN_REVISION "10001"
+#define SVN_REVISION "0UNKNOWN"
-- 
2.30.2


From ea1b6d1c1dede5e7d74c49664e5e8a3b2ecf124a Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Wed, 19 Sep 2018 15:36:35 +0300
Subject: Use default iconset on Haiku


diff --git a/src/preferences.cpp b/src/preferences.cpp
index 9d9eeac..3c13972 100644
--- a/src/preferences.cpp
+++ b/src/preferences.cpp
@@ -489,6 +489,9 @@ void Preferences::reset() {
 	gui = "DefaultGUI";
 	iconset = "H2O";
 
+#ifdef Q_OS_HAIKU
+	iconset = "Default";
+#endif
 
 #if USE_MINIMUMSIZE
 	gui_minimum_width = 0; // 0 == disabled
-- 
2.30.2

