From 309272b6f932a1c3a0728aedd7ad22fa9290f264 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Tue, 1 Sep 2009 11:00:10 +0000 Subject: [PATCH] don't repaint the entire widget when we're setting the same content CCBUG:204491 svn path=/trunk/KDE/kdelibs/; revision=1018140 --- extenderitem.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/extenderitem.cpp b/extenderitem.cpp index 3404f7a56..d11508978 100644 --- a/extenderitem.cpp +++ b/extenderitem.cpp @@ -156,9 +156,11 @@ KConfigGroup ExtenderItem::config() const void ExtenderItem::setTitle(const QString &title) { - d->title = title; - config().writeEntry("extenderTitle", title); - update(); + if (d->title != title) { + d->title = title; + config().writeEntry("extenderTitle", title); + update(); + } } QString ExtenderItem::title() const @@ -205,8 +207,10 @@ QGraphicsItem *ExtenderItem::widget() const void ExtenderItem::setIcon(const QIcon &icon) { - d->iconName.clear(); - d->collapseIcon->setIcon(icon); + if (d->collapseIcon->icon().isNull() || icon.cacheKey() != d->collapseIcon->icon().cacheKey()) { + d->iconName.clear(); + d->collapseIcon->setIcon(icon); + } } void ExtenderItem::setIcon(const QString &icon)