From 763ac6b862d32fbaa1e7d0b01961b981f22aef37 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Sat, 26 Dec 2009 12:16:45 +0000 Subject: [PATCH] don't do useless work if we are already expanded (or collapsed) svn path=/trunk/KDE/kdelibs/; revision=1066210 --- extenders/extendergroup.cpp | 8 ++++++++ extenders/extenderitem.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/extenders/extendergroup.cpp b/extenders/extendergroup.cpp index 4ee183bc9..86f1b1f98 100644 --- a/extenders/extendergroup.cpp +++ b/extenders/extendergroup.cpp @@ -116,6 +116,10 @@ void ExtenderGroup::setAutoHide(bool autoHide) void ExtenderGroup::expandGroup() { + if (d->collapsed == false) { + return; + } + d->collapsed = false; config().writeEntry("groupCollapsed", d->collapsed); action("collapse")->setVisible(true); @@ -130,6 +134,10 @@ void ExtenderGroup::expandGroup() void ExtenderGroup::collapseGroup() { + if (d->collapsed == true) { + return; + } + d->collapsed = true; config().writeEntry("groupCollapsed", d->collapsed); action("collapse")->setVisible(false); diff --git a/extenders/extenderitem.cpp b/extenders/extenderitem.cpp index be7cae72f..e768700f4 100644 --- a/extenders/extenderitem.cpp +++ b/extenders/extenderitem.cpp @@ -450,6 +450,10 @@ void ExtenderItem::destroy() void ExtenderItem::setCollapsed(bool collapsed) { + if (d->collapsed == collapsed) { + return; + } + config().writeEntry("isCollapsed", collapsed); d->collapsed = collapsed; if (d->widget) {