qt: portability fixes from Alpine; remove unused stuff.

This commit is contained in:
Juan RP 2015-05-09 06:14:15 +02:00
parent 34f1490de5
commit f1d9deaa4f
6 changed files with 122 additions and 1 deletions

View File

@ -0,0 +1,17 @@
Calling qsettings before constructing qapplications causes a dead-lock.
http://sourceforge.net/tracker/?func=detail&aid=3168620&group_id=4932&atid=104932
http://developer.qt.nokia.com/forums/viewthread/10365
--- a/src/corelib/io/qsettings.cpp.orig
+++ b/src/corelib/io/qsettings.cpp
@@ -122,7 +122,7 @@
Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc)
Q_GLOBAL_STATIC(PathHash, pathHashFunc)
Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc)
-Q_GLOBAL_STATIC(QMutex, globalMutex)
+Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive))
static QSettings::Format globalDefaultFormat = QSettings::NativeFormat;
#ifndef Q_OS_WIN

View File

@ -0,0 +1,17 @@
--- a/src/3rdparty/clucene/src/CLucene/util/Misc.cpp.orig
+++ b/src/3rdparty/clucene/src/CLucene/util/Misc.cpp
@@ -20,11 +20,11 @@
# endif
#endif
-#ifdef _CL_HAVE_SYS_TIMEB_H
+#ifndef UNDER_CE
+#ifdef _defined(_CLCOMPILER_MSVC) || defined(__MINGW32__) || defined(__BORLANDC__)
# include <sys/timeb.h>
#endif
-
-#ifdef UNDER_CE
+#else
#include <QTime>
#endif

View File

@ -0,0 +1,59 @@
Author: Timo Teräs <timo.teras@iki.fi>
Fix QT GTK style to use GTK API to get the active theme name. This fixes
things for non-GNOME setups, as well as realtime theme change detection.
It still tries to detect if GTK-Qt is in use and refuse to run with that
as it would cause obvious recursion, however that might be not always
possible.
--- a/src/gui/styles/qgtkstyle_p.cpp 2013-06-07 05:16:59.000000000 +0000
+++ b/src/gui/styles/qgtkstyle_p.cpp 2013-09-25 16:37:34.703506640 +0000
@@ -505,7 +505,7 @@ void QGtkStylePrivate::initGtkWidgets()
static QString themeName;
if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) {
- themeName = getThemeName();
+ themeName = getThemeNameGuess();
if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
// Due to namespace conflicts with Qt3 and obvious recursion with Qt4,
@@ -648,7 +648,7 @@ bool QGtkStylePrivate::getGConfBool(cons
return retVal;
}
-QString QGtkStylePrivate::getThemeName()
+QString QGtkStylePrivate::getThemeNameGuess()
{
QString themeName;
// We try to parse the gtkrc file first
@@ -685,6 +685,19 @@ QString QGtkStylePrivate::getThemeName()
return themeName;
}
+
+QString QGtkStylePrivate::getThemeName()
+{
+ QString themeName;
+ gchar *theme_name;
+
+ GtkSettings *settings = gtk_settings_get_default();
+ g_object_get(settings, "gtk-theme-name", &theme_name, NULL);
+ themeName = QString::fromUtf8(theme_name);
+ g_free(theme_name);
+
+ return themeName;
+}
// Get size of the arrow controls in a GtkSpinButton
int QGtkStylePrivate::getSpinboxArrowSize() const
--- a/src/gui/styles/qgtkstyle_p.h 2013-06-07 05:16:59.000000000 +0000
+++ b/src/gui/styles/qgtkstyle_p.h 2013-09-25 16:29:11.310167033 +0000
@@ -338,6 +338,7 @@ public:
static bool getGConfBool(const QString &key, bool fallback = 0);
static QString getGConfString(const QString &key, const QString &fallback = QString());
+ static QString getThemeNameGuess();
static QString getThemeName();
virtual int getSpinboxArrowSize() const;

View File

@ -0,0 +1,11 @@
--- qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp.orig
+++ qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp
@@ -62,7 +62,7 @@
#elif defined(Q_OS_AIX)
# define NO_BOM
# define UTF16 "UCS-2"
-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
+#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
# define NO_BOM
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
# define UTF16 "UTF-16BE"

View File

@ -0,0 +1,14 @@
--- qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h.orig
+++ qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h
@@ -86,11 +86,7 @@
#undef QT_SOCKLEN_T
-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#define QT_SOCKLEN_T socklen_t
-#else
-#define QT_SOCKLEN_T int
-#endif
#if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
#define QT_SNPRINTF ::snprintf

View File

@ -1,7 +1,7 @@
# Template file for 'qt'
pkgname=qt
version=4.8.6
revision=13
revision=14
_distname=qt-everywhere-opensource-src
patch_args="-Np1"
wrksrc=${_distname}-${version}
@ -80,6 +80,9 @@ do_install() {
for f in ${DESTDIR}/usr/lib/qt/bin/*; do
ln -s /usr/lib/qt/bin/$(basename $f) ${DESTDIR}/usr/bin/$(basename $f)-qt4
done
# Remove wrong stuff
rm -rf ${DESTDIR}/usr/{examples,demos}
}
qt-doc_package() {