aboutsummaryrefslogtreecommitdiffstats
path: root/main/qt
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2012-02-03 12:16:11 +0200
committerTimo Teräs <timo.teras@iki.fi>2012-02-03 12:16:59 +0200
commitb97618d2f714849ab9b7a10269d47f47ccb8875c (patch)
tree2f5fd6111d43781b5048f180b44bf44e3a3ec237 /main/qt
parentf82a1c79b86cfe5bd87a5a414249158521eb2801 (diff)
downloadaports-b97618d2f714849ab9b7a10269d47f47ccb8875c.tar.bz2
aports-b97618d2f714849ab9b7a10269d47f47ccb8875c.tar.xz
main/qt: fix GTK theme detection
Diffstat (limited to 'main/qt')
-rw-r--r--main/qt/APKBUILD4
-rw-r--r--main/qt/qt-gtk-theme-fix.patch65
2 files changed, 68 insertions, 1 deletions
diff --git a/main/qt/APKBUILD b/main/qt/APKBUILD
index 951463e158..5048583daa 100644
--- a/main/qt/APKBUILD
+++ b/main/qt/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=qt
pkgver=4.8.0
-pkgrel=0
+pkgrel=1
pkgdesc="A cross-platform application and UI framework"
url="http://qt.nokia.com/"
arch="all"
@@ -18,6 +18,7 @@ makedepends="$depends_dev postgresql-dev mysql-dev unixodbc-dev cups-dev
gtk+-dev tiff-dev libmng-dev libxrandr-dev libxv-dev libxi-dev perl"
install=
source="ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-$pkgver.tar.gz
+ qt-gtk-theme-fix.patch
assistant.desktop
designer.desktop
linguist.desktop
@@ -230,6 +231,7 @@ x11() {
}
md5sums="e8a5fdbeba2927c948d9f477a6abe904 qt-everywhere-opensource-src-4.8.0.tar.gz
+91e8b5ea1e682ae51b60a27d01d7d381 qt-gtk-theme-fix.patch
a445c6917086d80f1cfc1e40cb6b0132 assistant.desktop
d457f0a0ad68a3861c3cadefe3b42ded designer.desktop
668331d9798a0e2b94381efb7be4c513 linguist.desktop
diff --git a/main/qt/qt-gtk-theme-fix.patch b/main/qt/qt-gtk-theme-fix.patch
new file mode 100644
index 0000000000..5939b1fd1a
--- /dev/null
+++ b/main/qt/qt-gtk-theme-fix.patch
@@ -0,0 +1,65 @@
+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.
+
+--- qt-everywhere-opensource-src-4.8.0/src/gui/styles/qgtkstyle_p.h.orig
++++ qt-everywhere-opensource-src-4.8.0/src/gui/styles/qgtkstyle_p.h
+@@ -338,6 +338,7 @@
+ 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;
+
+--- qt-everywhere-opensource-src-4.8.0/src/gui/styles/qgtkstyle_p.cpp.orig
++++ qt-everywhere-opensource-src-4.8.0/src/gui/styles/qgtkstyle_p.cpp
+@@ -504,12 +504,9 @@
+
+ static QString themeName;
+ if (!gtkWidgetMap()->contains("GtkWindow") && themeName.isEmpty()) {
+- themeName = getThemeName();
++ themeName = getThemeNameGuess();
+
+- if (themeName.isEmpty()) {
+- qWarning("QGtkStyle was unable to detect the current GTK+ theme.");
+- return;
+- } else if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
++ if (themeName == QLS("Qt") || themeName == QLS("Qt4")) {
+ // Due to namespace conflicts with Qt3 and obvious recursion with Qt4,
+ // we cannot support the GTK_Qt Gtk engine
+ qWarning("QGtkStyle cannot be used together with the GTK_Qt engine.");
+@@ -650,7 +647,7 @@
+ return retVal;
+ }
+
+-QString QGtkStylePrivate::getThemeName()
++QString QGtkStylePrivate::getThemeNameGuess()
+ {
+ QString themeName;
+ // We try to parse the gtkrc file first
+@@ -684,6 +681,19 @@
+ // Fall back to gconf
+ if (themeName.isEmpty() && resolveGConf())
+ themeName = getGConfString(QLS("/desktop/gnome/interface/gtk_theme"));
++
++ 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;
+ }