Files
haikuports/app-text/goldendict/patches/goldendict-1.5.0rc2.patchset
2018-10-30 00:26:23 +02:00

234 lines
6.3 KiB
Plaintext

From b7d662630d522150ccf3aaffcb355b9023a74db1 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 8 Aug 2017 11:27:18 +0300
Subject: Haiku patch
diff --git a/goldendict.pro b/goldendict.pro
index 9ba9e69..4ccdeb4 100644
--- a/goldendict.pro
+++ b/goldendict.pro
@@ -138,7 +138,19 @@ win32 {
}
}
-unix:!mac {
+haiku {
+ LIBS += -liconv \
+ -lavutil \
+ -lavformat \
+ -lavcodec \
+ -lao \
+ -lhunspell-1.6 \
+ -lvorbisfile \
+ -lexecinfo
+
+}
+
+unix:!mac:!haiku {
DEFINES += HAVE_X11
# This is to keep symbols for backtraces
QMAKE_CXXFLAGS += -rdynamic
diff --git a/hotkeywrapper.cc b/hotkeywrapper.cc
index 267e0be..a0438c4 100644
--- a/hotkeywrapper.cc
+++ b/hotkeywrapper.cc
@@ -463,6 +463,23 @@ bool QHotkeyApplication::winEventFilter ( MSG * message, long * result )
//////////////////////////////////////////////////////////////////////////
+#elif defined(Q_OS_HAIKU)
+
+void HotkeyWrapper::init()
+{
+
+}
+
+bool HotkeyWrapper::setGlobalKey( int key, int key2,
+ Qt::KeyboardModifiers modifier, int handle )
+{
+ return true;
+}
+
+void HotkeyWrapper::unregister()
+{
+
+}
#else
//////////////////////////////////////////////////////////////////////////
diff --git a/hotkeywrapper.hh b/hotkeywrapper.hh
index a27873e..e2bdf22 100644
--- a/hotkeywrapper.hh
+++ b/hotkeywrapper.hh
@@ -107,7 +107,7 @@ private:
EventHandlerRef handlerRef;
#else
-
+#ifndef Q_OS_HAIKU
static void recordEventCallback( XPointer, XRecordInterceptData * );
/// Called by recordEventCallback()
@@ -118,9 +118,9 @@ private:
// We do one-time init of those, translating keysyms to keycodes
KeyCode lShiftCode, rShiftCode, lCtrlCode, rCtrlCode, lAltCode, rAltCode,
cCode, insertCode, kpInsertCode, lMetaCode, rMetaCode;
-
+#endif
quint32 currentModifiers;
-
+#ifndef Q_OS_HAIKU
Display * dataDisplay;
XRecordRange * recordRange;
XRecordContext recordContext;
@@ -145,7 +145,7 @@ private:
/// Ungrabs the given key. erasing it from grabbedKeys. The key's provided
/// as an interator inside the grabbedKeys set.
void ungrabKey( GrabbedKeys::iterator );
-
+#endif
signals:
/// Emitted from the thread
diff --git a/keyboardstate.cc b/keyboardstate.cc
index 29c986f..f3787d7 100644
--- a/keyboardstate.cc
+++ b/keyboardstate.cc
@@ -40,6 +40,7 @@ bool KeyboardState::checkModifiersPressed( int mask )
( mask & Shift && !( keys & ( 1 << shiftKeyBit ) ) ) ||
( mask & Win && !( keys & ( 1 << controlKeyBit ) ) ) );
#else
+ #ifndef Q_OS_HAIKU
XkbStateRec state;
XkbGetState( QX11Info::display(), XkbUseCoreKbd, &state );
@@ -50,5 +51,14 @@ bool KeyboardState::checkModifiersPressed( int mask )
( mask & Shift && !( state.base_mods & ShiftMask ) ) ||
( mask & Win && !( state.base_mods & Mod4Mask ) ) );
#endif
+//
+/* uint32 mask = modifiers();
+return !(
+( mask & B_COMMAND_KEY && !( state.base_mods & Mod1Mask ) ) ||
+( mask & B_CONTROL_KEY && !( state.base_mods & ControlMask ) ) ||
+( mask & B_SHIFT_KEY && !( state.base_mods & ShiftMask ) ) ||
+( mask & B_OPTION_KEY && !( state.base_mods & Mod4Mask ) ) );*/
+
+ #endif
}
diff --git a/loaddictionaries.cc b/loaddictionaries.cc
index cf31e63..91f799e 100644
--- a/loaddictionaries.cc
+++ b/loaddictionaries.cc
@@ -80,12 +80,12 @@ void LoadDictionaries::run()
// Make soundDirs
{
- vector< sptr< Dictionary::Class > > soundDirDictionaries =
+/* vector< sptr< Dictionary::Class > > soundDirDictionaries =
SoundDir::makeDictionaries( soundDirs, FsEncoding::encode( Config::getIndexDir() ), *this );
dictionaries.insert( dictionaries.end(), soundDirDictionaries.begin(),
soundDirDictionaries.end() );
- }
+*/ }
// Make hunspells
{
--
2.19.1
From 11598184c6b085b9803b9004b0a2a6fcf6ca22b5 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Wed, 4 Jul 2018 23:37:22 +1000
Subject: Fix build for gcc7
diff --git a/ffmpegaudio.cc b/ffmpegaudio.cc
index 04c35d8..7e803d1 100644
--- a/ffmpegaudio.cc
+++ b/ffmpegaudio.cc
@@ -143,7 +143,7 @@ bool DecoderContext::openCodec( QString & errorString )
return false;
}
- unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + FF_INPUT_BUFFER_PADDING_SIZE );
+ unsigned char * avioBuffer = ( unsigned char * )av_malloc( kBufferSize + AV_INPUT_BUFFER_PADDING_SIZE );
if ( !avioBuffer )
{
errorString = QObject::tr( "av_malloc() failed." );
@@ -380,7 +380,7 @@ bool DecoderContext::play( QString & errorString )
}
if ( !Qt4x5::AtomicInt::loadAcquire( isCancelled_ ) &&
- codecContext_->codec->capabilities & CODEC_CAP_DELAY )
+ codecContext_->codec->capabilities & AV_CODEC_CAP_DELAY )
{
av_init_packet( &packet );
int gotFrame = 0;
diff --git a/fulltextsearch.hh b/fulltextsearch.hh
index cedeed6..36e5ce4 100644
--- a/fulltextsearch.hh
+++ b/fulltextsearch.hh
@@ -6,6 +6,7 @@
#include <QRegExp>
#include <QAbstractListModel>
#include <QList>
+#include <QAction>
#include "dictionary.hh"
#include "ui_fulltextsearch.h"
diff --git a/groups_widgets.hh b/groups_widgets.hh
index ce442fa..ce21c32 100644
--- a/groups_widgets.hh
+++ b/groups_widgets.hh
@@ -10,6 +10,7 @@
#include <QListWidget>
#include <QSortFilterProxyModel>
+#include <QAction>
#include "config.hh"
#include "dictionary.hh"
diff --git a/initializing.cc b/initializing.cc
index 0db6909..f467925 100644
--- a/initializing.cc
+++ b/initializing.cc
@@ -3,6 +3,7 @@
#include "initializing.hh"
#include <QCloseEvent>
+#include <QIcon>
#if ( QT_VERSION >= QT_VERSION_CHECK( 5, 0, 0 ) ) && defined( Q_OS_WIN32 )
#include <QtWidgets/QStyleFactory>
--
2.19.1
From 0e39b7226b93c5b919b303db904294c84f5e1295 Mon Sep 17 00:00:00 2001
From: Nikolay Korotkiy <sikmir@gmail.com>
Date: Mon, 29 Oct 2018 22:41:18 +0000
Subject: Fix config path
diff --git a/config.cc b/config.cc
index 9b27b31..4ef5b05 100644
--- a/config.cc
+++ b/config.cc
@@ -37,6 +37,8 @@ namespace
return result;
char const * pathInHome = "GoldenDict";
result = QDir::fromNativeSeparators( QString::fromWCharArray( _wgetenv( L"APPDATA" ) ) );
+ #elif defined(Q_OS_HAIKU)
+ char const * pathInHome = "config/settings/Goldendict";
#else
char const * pathInHome = ".goldendict";
#endif
--
2.19.1