don't do useless work if we are already expanded (or collapsed)

svn path=/trunk/KDE/kdelibs/; revision=1066210
This commit is contained in:
Marco Martin 2009-12-26 12:16:45 +00:00
parent 8312e39011
commit 763ac6b862
2 changed files with 12 additions and 0 deletions

View File

@ -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);

View File

@ -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) {