don't repaint the entire widget when we're setting the same content

CCBUG:204491

svn path=/trunk/KDE/kdelibs/; revision=1018140
This commit is contained in:
Aaron J. Seigo 2009-09-01 11:00:10 +00:00
parent eb5b7d040c
commit 309272b6f9

View File

@ -156,10 +156,12 @@ KConfigGroup ExtenderItem::config() const
void ExtenderItem::setTitle(const QString &title) void ExtenderItem::setTitle(const QString &title)
{ {
if (d->title != title) {
d->title = title; d->title = title;
config().writeEntry("extenderTitle", title); config().writeEntry("extenderTitle", title);
update(); update();
} }
}
QString ExtenderItem::title() const QString ExtenderItem::title() const
{ {
@ -205,9 +207,11 @@ QGraphicsItem *ExtenderItem::widget() const
void ExtenderItem::setIcon(const QIcon &icon) void ExtenderItem::setIcon(const QIcon &icon)
{ {
if (d->collapseIcon->icon().isNull() || icon.cacheKey() != d->collapseIcon->icon().cacheKey()) {
d->iconName.clear(); d->iconName.clear();
d->collapseIcon->setIcon(icon); d->collapseIcon->setIcon(icon);
} }
}
void ExtenderItem::setIcon(const QString &icon) void ExtenderItem::setIcon(const QString &icon)
{ {