From 6d7622271c2e1ebdaa1e1bcaf323914269107187 Mon Sep 17 00:00:00 2001 From: "Aaron J. Seigo" Date: Fri, 24 Apr 2009 19:27:58 +0000 Subject: [PATCH] * Toolbox -> ToolBox * emit the signals only when things change svn path=/trunk/KDE/kdelibs/; revision=958822 --- containment.cpp | 14 +++++++------- containment.h | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/containment.cpp b/containment.cpp index 89ef26d62..5569db236 100644 --- a/containment.cpp +++ b/containment.cpp @@ -1288,15 +1288,17 @@ void Containment::setToolBoxOpen(bool open) void Containment::openToolBox() { - if (d->toolBox) { + if (d->toolBox && !d->toolBox->showing()) { d->toolBox->showToolBox(); + emit toolBoxVisibilityChanged(true); } } void Containment::closeToolBox() { - if (d->toolBox) { + if (d->toolBox && d->toolBox->showing()) { d->toolBox->hideToolBox(); + emit toolBoxVisibilityChanged(false); } } @@ -1587,7 +1589,7 @@ ToolBox *ContainmentPrivate::createToolBox() if (toolBox) { QObject::connect(toolBox, SIGNAL(toggled()), q, SIGNAL(toolBoxToggled())); - QObject::connect(toolBox, SIGNAL(toggled()), q, SLOT(updateToolboxVisibility())); + QObject::connect(toolBox, SIGNAL(toggled()), q, SLOT(updateToolBoxVisibility())); toolBox->load(); positionToolBox(); } @@ -1603,11 +1605,9 @@ void ContainmentPrivate::positionToolBox() } } -void ContainmentPrivate::updateToolboxVisibility() +void ContainmentPrivate::updateToolBoxVisibility() { - if (toolBox) { - emit q->toolBoxVisibilityChanged(toolBox->showing()); - } + emit q->toolBoxVisibilityChanged(toolBox->showing()); } void ContainmentPrivate::triggerShowAddWidgets() diff --git a/containment.h b/containment.h index de2c56e37..80e6aec3c 100644 --- a/containment.h +++ b/containment.h @@ -550,7 +550,7 @@ class PLASMA_EXPORT Containment : public Applet Q_PRIVATE_SLOT(d, void zoomIn()) Q_PRIVATE_SLOT(d, void zoomOut()) Q_PRIVATE_SLOT(d, void requestConfiguration()) - Q_PRIVATE_SLOT(d, void updateToolboxVisibility()) + Q_PRIVATE_SLOT(d, void updateToolBoxVisibility()) friend class Applet; friend class AppletPrivate;