rev 16365 - in trunk/packages/kdelibs/debian: . patches
Modestas Vainius
modax at alioth.debian.org
Mon Dec 7 23:01:32 UTC 2009
Author: modax
Date: 2009-12-07 23:01:10 +0000 (Mon, 07 Dec 2009)
New Revision: 16365
Added:
trunk/packages/kdelibs/debian/patches/00_1034808_4.4_backport_rtldglobal.diff
Modified:
trunk/packages/kdelibs/debian/changelog
trunk/packages/kdelibs/debian/patches/series
Log:
Backport a patch from KDE 4.4 to make it possible to use kstyle plugins
with RTLD_GLOBAL. Unbreaks openoffice.org (Closes: #550905) (patch
00_1034808_4.4_backport_rtldglobal.diff, kde4libs part).
Modified: trunk/packages/kdelibs/debian/changelog
===================================================================
--- trunk/packages/kdelibs/debian/changelog 2009-12-07 22:30:28 UTC (rev 16364)
+++ trunk/packages/kdelibs/debian/changelog 2009-12-07 23:01:10 UTC (rev 16365)
@@ -24,6 +24,9 @@
* Update install files.
* Remove obsolete information from README.Debian. Add notes
for people upgrading from Lenny to Squeeze regarding KDEHOME change.
+ * Backport a patch from KDE 4.4 to make it possible to use kstyle plugins
+ with RTLD_GLOBAL. Unbreaks openoffice.org (Closes: #550905) (patch
+ 00_1034808_4.4_backport_rtldglobal.diff, kde4libs part).
+++ Changes by Pino Toscano:
Added: trunk/packages/kdelibs/debian/patches/00_1034808_4.4_backport_rtldglobal.diff
===================================================================
--- trunk/packages/kdelibs/debian/patches/00_1034808_4.4_backport_rtldglobal.diff (rev 0)
+++ trunk/packages/kdelibs/debian/patches/00_1034808_4.4_backport_rtldglobal.diff 2009-12-07 23:01:10 UTC (rev 16365)
@@ -0,0 +1,61 @@
+From: Lubos Lunak <l.lunak at suse.cz>
+Subject: do not use dynamic_cast, breaks RTLD_GLOBAL
+ Plugins really shouldn't use dynamic_cast, it breaks without RTLD_GLOBAL
+ and especially with plugins that is quite likely to happen with 3rd party
+ apps (e.g. http://bugzilla.novell.com/529640).
+ And the best I could come up with was playing with typeid().name(), which
+ works, except for subclassing.
+ .
+ The patch was backported from KDE 4.4.
+Forwarded: not-needed
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550905
+Origin: upstream, svn diff -c 1034808 svn://anonsvn.kde.org/home/kde
+
+--- a/kdeui/kernel/kstyle.h
++++ b/kdeui/kernel/kstyle.h
+@@ -40,6 +40,7 @@
+ #include <QtGui/QCommonStyle>
+ #include <QtGui/QPalette>
+ #include <QtGui/QStylePlugin>
++#include <typeinfo>
+
+ class QStyleOptionProgressBar;
+ class QStyleOptionTab;
+@@ -1578,6 +1579,9 @@
+ // fitt's law label support: QLabel focusing its buddy widget
+ const QObject *clickedLabel;
+
++ template<typename T>
++ static T extractOptionHelper(T*);
++
+ public:
+ /** @name QStyle Methods
+ * These are methods reimplemented from QStyle. Usually it's not necessary to
+@@ -1669,12 +1673,25 @@
+ }
+ };
+
++// get the pointed-to type from a pointer
++template<typename T>
++T KStyle::extractOptionHelper(T*)
++{
++ return T();
++}
+
+ template<typename T>
+ T KStyle::extractOption(Option* option)
+ {
+- if (option && dynamic_cast<T>(option)) {
+- return static_cast<T>(option);
++ if (option) {
++ if (dynamic_cast<T>(option))
++ return static_cast<T>(option);
++ // Ugly hacks for when RTLD_GLOBAL is not used (quite common with plugins, really)
++ // and dynamic_cast fails.
++ // This is still partially broken as it doesn't take into account subclasses.
++ // ### KDE5 do this somehow differently
++ if ( qstrcmp(typeid(*option).name(), typeid(extractOptionHelper(static_cast<T>(0))).name()) == 0 )
++ return static_cast<T>(option);
+ }
+
+ //### warn if cast failed?
Modified: trunk/packages/kdelibs/debian/patches/series
===================================================================
--- trunk/packages/kdelibs/debian/patches/series 2009-12-07 22:30:28 UTC (rev 16364)
+++ trunk/packages/kdelibs/debian/patches/series 2009-12-07 23:01:10 UTC (rev 16365)
@@ -1,3 +1,4 @@
+00_1034808_4.4_backport_rtldglobal.diff
08_add_debian_build_type.diff
11_default_kde4_xdg_menu_prefix.diff
13_qt4_designer_plugins_path.diff
More information about the pkg-kde-commits
mailing list