vacuum-1.3.0.20180105.patchset revision 53a8c6f8
1From b9f30f4071fb445779629401067dd2820c921cd4 Mon Sep 17 00:00:00 2001
2From: Sergei Reznikov <diver@gelios.net>
3Date: Thu, 4 May 2017 17:26:25 +0300
4Subject: Fix build on Haiku
5
6
7diff --git a/src/loader/pluginmanager.cpp b/src/loader/pluginmanager.cpp
8index 6d65738..a5d6072 100644
9--- a/src/loader/pluginmanager.cpp
10+++ b/src/loader/pluginmanager.cpp
11@@ -53,7 +53,7 @@
12 #  define ENV_APP_DATA              "HOME"
13 #  define DIR_APP_DATA              APPLICATION_NAME
14 #  define PATH_APP_DATA             "Library/Application Support/" DIR_APP_DATA
15-#elif defined(Q_WS_HAIKU)
16+#elif defined(Q_OS_HAIKU)
17 #  define ENV_APP_DATA              "APPDATA"
18 #  define DIR_APP_DATA              APPLICATION_NAME
19 #  define PATH_APP_DATA             ORGANIZATION_NAME "/" DIR_APP_DATA
20diff --git a/src/thirdparty/minizip/ioapi.c b/src/thirdparty/minizip/ioapi.c
21index 7f5c191..649255c 100644
22--- a/src/thirdparty/minizip/ioapi.c
23+++ b/src/thirdparty/minizip/ioapi.c
24@@ -14,7 +14,7 @@
25         #define _CRT_SECURE_NO_WARNINGS
26 #endif
27 
28-#if defined(__APPLE__) || defined(IOAPI_NO_64)
29+#if defined(__APPLE__) || defined(IOAPI_NO_64) || defined(__HAIKU__)
30 // In darwin and perhaps other BSD variants off_t is a 64 bit value, hence no need for specific 64 bit functions
31 #define FOPEN_FUNC(filename, mode) fopen(filename, mode)
32 #define FTELLO_FUNC(stream) ftello(stream)
33diff --git a/src/thirdparty/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp b/src/thirdparty/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp
34index 126c946..65a0db1 100644
35--- a/src/thirdparty/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp
36+++ b/src/thirdparty/qxtglobalshortcut/qxtglobalshortcut_haiku.cpp
37@@ -28,185 +28,8 @@
38 #include <QWidget>
39 #include <QCoreApplication>
40 
41-bool QxtGlobalShortcutPrivate::eventFilter(void* message)
42-{
43-    BMessage *msg = static_cast<BMessage*>(message);
44- //   if (msg->message == WM_HOTKEY)
45-   // {
46-     //   const quint32 keycode = HIWORD(msg->lParam);
47-       // const quint32 modifiers = LOWORD(msg->lParam);
48-       // activateShortcut(keycode, modifiers);
49-    //}
50-    return false;
51-}
52-quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers)
53-{
54-    // ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, Mod4Mask, and Mod5Mask
55-/*    quint32 native = 0;
56-    if (modifiers & Qt::ShiftModifier)
57-        native |= ShiftMask;
58-    if (modifiers & Qt::ControlModifier)
59-        native |= ControlMask;
60-    if (modifiers & Qt::AltModifier)
61-        native |= Mod1Mask;
62-    if (modifiers & Qt::MetaModifier)
63-        native |= Mod4Mask;
64-*/
65-    // TODO: resolve these?
66-    //if (modifiers & Qt::MetaModifier)
67-    //if (modifiers & Qt::KeypadModifier)
68-    //if (modifiers & Qt::GroupSwitchModifier)
69-    //return native;
70-}
71-
72-quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key)
73-{
74-    switch (key)
75-    {
76-    case Qt::Key_Escape:
77-        return B_ESCAPE;
78-    case Qt::Key_Tab:
79-    case Qt::Key_Backtab:
80-        return B_TAB;
81-    case Qt::Key_Backspace:
82-        return B_BACKSPACE;
83-    case Qt::Key_Return:
84-        return B_RETURN;
85-    case Qt::Key_Enter:
86-        return B_ENTER;
87-    case Qt::Key_Insert:
88-        return B_INSERT;
89-    case Qt::Key_Delete:
90-        return B_DELETE;
91-    case Qt::Key_Pause:
92-        return B_PAUSE_KEY;
93-    case Qt::Key_Print:
94-        return B_PRINT_KEY;
95-//  case Qt::Key_Clear:
96-//      return B_CLEAR;
97-    case Qt::Key_Home:
98-        return B_HOME;
99-    case Qt::Key_End:
100-        return B_END;
101-    case Qt::Key_Left:
102-        return B_LEFT_ARROW;
103-    case Qt::Key_Up:
104-        return B_UP_ARROW;
105-    case Qt::Key_Right:
106-        return B_RIGHT_ARROW;
107-    case Qt::Key_Down:
108-        return B_DOWN_ARROW;
109-    case Qt::Key_PageUp:
110-        return B_PAGE_UP;
111-    case Qt::Key_PageDown:
112-        return B_PAGE_DOWN;
113-    case Qt::Key_F1:
114-        return B_F1_KEY;
115-    case Qt::Key_F2:
116-        return B_F2_KEY;
117-    case Qt::Key_F3:
118-        return B_F3_KEY;
119-    case Qt::Key_F4:
120-        return B_F4_KEY;
121-    case Qt::Key_F5:
122-        return B_F5_KEY;
123-    case Qt::Key_F6:
124-        return B_F6_KEY;
125-    case Qt::Key_F7:
126-        return B_F7_KEY;
127-    case Qt::Key_F8:
128-        return B_F8_KEY;
129-    case Qt::Key_F9:
130-        return B_F9_KEY;
131-    case Qt::Key_F10:
132-        return B_F10_KEY;
133-    case Qt::Key_F11:
134-        return B_F11_KEY;
135-    case Qt::Key_F12:
136-        return B_F12_KEY;
137-    case Qt::Key_Space:
138-        return B_SPACE;
139-/*    case Qt::Key_Asterisk:
140-        return B_MULTIPLY;
141-    case Qt::Key_Plus:
142-        return B_ADD;
143-    case Qt::Key_Comma:
144-        return B_SEPARATOR;
145-    case Qt::Key_Minus:
146-        return B_SUBTRACT;
147-    case Qt::Key_Slash:
148-        return B_DIVIDE;
149-    case Qt::Key_MediaNext:
150-        return B_MEDIA_NEXT_TRACK;
151-    case Qt::Key_MediaPrevious:
152-        return B_MEDIA_PREV_TRACK;
153-    case Qt::Key_MediaPlay:
154-        return B_MEDIA_PLAY_PAUSE;
155-    case Qt::Key_MediaStop:
156-        return B_MEDIA_STOP;
157-        // couldn't find those in B_*
158-        //case Qt::Key_MediaLast:
159-        //case Qt::Key_MediaRecord:
160-    case Qt::Key_VolumeDown:
161-        return B_VOLUME_DOWN;
162-    case Qt::Key_VolumeUp:
163-        return B_VOLUME_UP;
164-    case Qt::Key_VolumeMute:
165-        return B_VOLUME_MUTE;
166-*/
167-        // numbers
168-    case Qt::Key_0:
169-    case Qt::Key_1:
170-    case Qt::Key_2:
171-    case Qt::Key_3:
172-    case Qt::Key_4:
173-    case Qt::Key_5:
174-    case Qt::Key_6:
175-    case Qt::Key_7:
176-    case Qt::Key_8:
177-    case Qt::Key_9:
178-        return key;
179-
180-        // letters
181-    case Qt::Key_A:
182-    case Qt::Key_B:
183-    case Qt::Key_C:
184-    case Qt::Key_D:
185-    case Qt::Key_E:
186-    case Qt::Key_F:
187-    case Qt::Key_G:
188-    case Qt::Key_H:
189-    case Qt::Key_I:
190-    case Qt::Key_J:
191-    case Qt::Key_K:
192-    case Qt::Key_L:
193-    case Qt::Key_M:
194-    case Qt::Key_N:
195-    case Qt::Key_O:
196-    case Qt::Key_P:
197-    case Qt::Key_Q:
198-    case Qt::Key_R:
199-    case Qt::Key_S:
200-    case Qt::Key_T:
201-    case Qt::Key_U:
202-    case Qt::Key_V:
203-    case Qt::Key_W:
204-    case Qt::Key_X:
205-    case Qt::Key_Y:
206-    case Qt::Key_Z:
207-        return key;
208-
209-    default:
210-        return 0;
211-    }
212-}
213-
214-bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods)
215-{
216-  //  return RegisterHotKey(0, nativeMods ^ nativeKey, nativeMods, nativeKey);
217-}
218-
219-bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods)
220-{
221-   // return UnregisterHotKey(0, nativeMods ^ nativeKey);
222-}
223+bool QxtGlobalShortcutPrivate::nativeEventFilter(const QByteArray & eventType, void *message, long *result){return false;}
224+quint32 QxtGlobalShortcutPrivate::nativeModifiers(Qt::KeyboardModifiers modifiers){return false;}
225+quint32 QxtGlobalShortcutPrivate::nativeKeycode(Qt::Key key){return 0;}
226+bool QxtGlobalShortcutPrivate::registerShortcut(quint32 nativeKey, quint32 nativeMods){return false;}
227+bool QxtGlobalShortcutPrivate::unregisterShortcut(quint32 nativeKey, quint32 nativeMods){return false;}
228-- 
2292.19.1
230
231
232From e7f43b351d36b2c8ea083e4e079c627b02f6e4af Mon Sep 17 00:00:00 2001
233From: Gerasim Troeglazov <3dEyes@gmail.com>
234Date: Sat, 30 Mar 2019 11:54:01 +1000
235Subject: Ugly fix for crash on exit
236
237
238diff --git a/src/loader/main.cpp b/src/loader/main.cpp
239index ed632c3..01b514f 100644
240--- a/src/loader/main.cpp
241+++ b/src/loader/main.cpp
242@@ -2,6 +2,12 @@
243 #include <QApplication>
244 #include "pluginmanager.h"
245 
246+#ifdef __HAIKU__
247+#include <unistd.h>
248+#include <sys/types.h>
249+#include <signal.h>
250+#endif
251+
252 int main(int argc, char *argv[])
253 {
254 	QApplication::setAttribute(Qt::AA_EnableHighDpiScaling,true);
255@@ -16,7 +22,12 @@ int main(int argc, char *argv[])
256 
257 	PluginManager pm(&app);
258 	pm.restart();
259-
260+#ifdef __HAIKU__
261+	app.exec();
262+	kill(::getpid(), SIGKILL);
263+	return 0;
264+#else
265 	return app.exec();
266+#endif
267 }
268 
269-- 
2702.19.1
271
272