diff options
author | 2011-05-09 18:19:11 +0000 | |
---|---|---|
committer | 2011-05-09 18:19:11 +0000 | |
commit | 64ee8e18a736388eee176d6bbdb7ccbdfcab374d (patch) | |
tree | b56cdab16799dbef82443fe74546ff66a491359f /kde-base | |
parent | Version bump (diff) | |
download | gentoo-2-64ee8e18a736388eee176d6bbdb7ccbdfcab374d.tar.gz gentoo-2-64ee8e18a736388eee176d6bbdb7ccbdfcab374d.tar.bz2 gentoo-2-64ee8e18a736388eee176d6bbdb7ccbdfcab374d.zip |
Apply upstream patch to fix plasma crash when removing icons from systray. Thanks to Ian (thev00d00) for the pointer.
(Portage version: 2.2.0_alpha32/cvs/Linux x86_64)
Diffstat (limited to 'kde-base')
-rw-r--r-- | kde-base/kdelibs/ChangeLog | 9 | ||||
-rw-r--r-- | kde-base/kdelibs/files/kdelibs-4.6.3-use_QWeakPointer.patch | 115 | ||||
-rw-r--r-- | kde-base/kdelibs/kdelibs-4.6.3-r1.ebuild (renamed from kde-base/kdelibs/kdelibs-4.6.3.ebuild) | 3 |
3 files changed, 125 insertions, 2 deletions
diff --git a/kde-base/kdelibs/ChangeLog b/kde-base/kdelibs/ChangeLog index 1181164c3f8f..e9b42f32fbec 100644 --- a/kde-base/kdelibs/ChangeLog +++ b/kde-base/kdelibs/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for kde-base/kdelibs # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/ChangeLog,v 1.754 2011/05/09 08:48:36 tomka Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/ChangeLog,v 1.755 2011/05/09 18:19:11 scarabeus Exp $ + +*kdelibs-4.6.3-r1 (09 May 2011) + + 09 May 2011; Tomáš Chvátal <scarabeus@gentoo.org> -kdelibs-4.6.3.ebuild, + +kdelibs-4.6.3-r1.ebuild, +files/kdelibs-4.6.3-use_QWeakPointer.patch: + Apply upstream patch to fix plasma crash when removing icons from systray. + Thanks to Ian (thev00d00) for the pointer. 09 May 2011; Thomas Kahle <tomka@gentoo.org> kdelibs-4.6.2-r3.ebuild: x86 stable per bug 354033 diff --git a/kde-base/kdelibs/files/kdelibs-4.6.3-use_QWeakPointer.patch b/kde-base/kdelibs/files/kdelibs-4.6.3-use_QWeakPointer.patch new file mode 100644 index 000000000000..718c466bb48c --- /dev/null +++ b/kde-base/kdelibs/files/kdelibs-4.6.3-use_QWeakPointer.patch @@ -0,0 +1,115 @@ +From: Aaron Seigo <aseigo@kde.org> +Date: Fri, 06 May 2011 13:19:09 +0000 +Subject: use a QWeakPointer on the KIconLoader passed in as there are no lifetime guarantees +X-Git-Url: http://quickgit.kde.org/?p=kdelibs.git&a=commitdiff&h=a8d16682c31ef523ffebba6e19283a19cd5f5627 +--- +use a QWeakPointer on the KIconLoader passed in as there are no lifetime guarantees + +usually KGlobal::iconLoader() is used, so this isn't an issue seen very often. +however, when a local KIconLoader is created, it is easy to get QIcons with a +KIconEngine that has a bad KIconLoader pointer in them. particularly as QIcon +is implicitly shared and easily passed around. the StatusNotifier Plasma DataEngine +was triggering this, though it would be trivial to run into this problem again +anytime a KIconLoader is created locally + +thankfully, QWeakPointer does the job and is very fast and light. (confirmed +both with my own testing and confirmation from Thiago). + +massive thanks to Michael Pyne for detecting the cause of the problem via Valgrind. + +BUG:258706 +--- + + +--- a/kdeui/icons/kiconengine.cpp ++++ b/kdeui/icons/kiconengine.cpp +@@ -27,16 +27,16 @@ + + + KIconEngine::KIconEngine(const QString& iconName, KIconLoader* iconLoader, const QStringList& overlays) ++ : mIconName(iconName), ++ mIconLoader(iconLoader), ++ mOverlays(overlays) + { +- mIconName = iconName; +- mIconLoader = iconLoader; +- mOverlays = overlays; + } + + KIconEngine::KIconEngine(const QString& iconName, KIconLoader* iconLoader) ++ : mIconName(iconName), ++ mIconLoader(iconLoader) + { +- mIconName = iconName; +- mIconLoader = iconLoader; + } + + static inline int qIconModeToKIconState( QIcon::Mode mode ) +@@ -65,8 +65,12 @@ QSize KIconEngine::actualSize( const QSi + return QSize(iconSize, iconSize); + } + +-void KIconEngine::paint( QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state ) ++void KIconEngine::paint(QPainter * painter, const QRect & rect, QIcon::Mode mode, QIcon::State state) + { ++ if (!mIconLoader) { ++ return; ++ } ++ + Q_UNUSED(state) + + const int kstate = qIconModeToKIconState(mode); +@@ -80,20 +84,27 @@ void KIconEngine::paint( QPainter * pain + } + + const int iconSize = qMin(rect.width(), rect.height()); +- const QPixmap pix = mIconLoader->loadIcon(mIconName, group, iconSize, kstate, mOverlays); ++ const QPixmap pix = mIconLoader.data()->loadIcon(mIconName, group, iconSize, kstate, mOverlays); + painter->drawPixmap(rect, pix); + } + +-QPixmap KIconEngine::pixmap( const QSize & size, QIcon::Mode mode, QIcon::State state ) ++QPixmap KIconEngine::pixmap(const QSize & size, QIcon::Mode mode, QIcon::State state) + { + Q_UNUSED(state) + ++ if (!mIconLoader) { ++ QPixmap pm(size); ++ pm.fill(Qt::transparent); ++ return pm; ++ } ++ + const int kstate = qIconModeToKIconState(mode); + const int iconSize = qMin(size.width(), size.height()); +- QPixmap pix = mIconLoader->loadIcon(mIconName, KIconLoader::Desktop, iconSize, kstate, mOverlays); ++ QPixmap pix = mIconLoader.data()->loadIcon(mIconName, KIconLoader::Desktop, iconSize, kstate, mOverlays); + +- if(pix.size() == size) ++ if (pix.size() == size) { + return pix; ++ } + + QPixmap pix2(size); + pix2.fill(QColor(0,0,0,0)); +@@ -111,7 +122,7 @@ QString KIconEngine::key() const + + QIconEngineV2 *KIconEngine::clone() const + { +- return new KIconEngine(mIconName, mIconLoader, mOverlays); ++ return new KIconEngine(mIconName, mIconLoader.data(), mOverlays); + } + + bool KIconEngine::read(QDataStream &in) + +--- a/kdeui/icons/kiconengine_p.h ++++ b/kdeui/icons/kiconengine_p.h +@@ -75,7 +75,7 @@ class KIconEngine : public QIconEngineV2 + private: + QString mIconName; + QStringList mOverlays; +- KIconLoader* mIconLoader; ++ QWeakPointer<KIconLoader> mIconLoader; + }; + + inline KIconEngine::~KIconEngine() + diff --git a/kde-base/kdelibs/kdelibs-4.6.3.ebuild b/kde-base/kdelibs/kdelibs-4.6.3-r1.ebuild index a9b7d7bebc01..aca8fe762488 100644 --- a/kde-base/kdelibs/kdelibs-4.6.3.ebuild +++ b/kde-base/kdelibs/kdelibs-4.6.3-r1.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-4.6.3.ebuild,v 1.2 2011/05/08 20:53:38 dilfridge Exp $ +# $Header: /var/cvsroot/gentoo-x86/kde-base/kdelibs/kdelibs-4.6.3-r1.ebuild,v 1.1 2011/05/09 18:19:11 scarabeus Exp $ EAPI=4 @@ -135,6 +135,7 @@ PATCHES=( "${FILESDIR}/${PN}-4.4.90-xslt.patch" "${FILESDIR}/${PN}-4.6.2-nonepomuk.patch" "${FILESDIR}/${PN}-4.6.3-no_suid_kdeinit.patch" + "${FILESDIR}/${PN}-4.6.3-use_QWeakPointer.patch" ) pkg_pretend() { |