don't bother making or destroying busy widgets/overlays if we're already in the right busy state

svn path=/trunk/KDE/kdelibs/; revision=954122
This commit is contained in:
Aaron J. Seigo 2009-04-15 07:29:23 +00:00
parent a792e89d2d
commit 7df3fb6228

View File

@ -670,16 +670,18 @@ Extender *Applet::extender() const
void Applet::setBusy(bool busy)
{
if (busy) {
d->createMessageOverlay(false);
d->messageOverlay->opacity = 0;
if (!d->busyWidget) {
d->createMessageOverlay(false);
d->messageOverlay->opacity = 0;
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(d->messageOverlay);
d->busyWidget = new Plasma::BusyWidget(d->messageOverlay);
QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(d->messageOverlay);
d->busyWidget = new Plasma::BusyWidget(d->messageOverlay);
mainLayout->addStretch();
mainLayout->addItem(d->busyWidget);
mainLayout->addStretch();
} else {
mainLayout->addStretch();
mainLayout->addItem(d->busyWidget);
mainLayout->addStretch();
}
} else if (d->busyWidget) {
//will be deleted by its parent
d->busyWidget = 0;
d->destroyMessageOverlay();