don't emit uireadychanged if not changed

This commit is contained in:
Marco Martin 2013-08-12 13:38:31 +02:00
parent 8750d01f40
commit 04650605e5
3 changed files with 11 additions and 3 deletions

View File

@ -397,8 +397,10 @@ void Containment::addApplet(Applet *applet)
if (!applet->d->uiReady) {
d->loadingApplets << applet;
static_cast<Applet *>(this)->d->uiReady = false;
emit uiReadyChanged(false);
if (static_cast<Applet *>(this)->d->uiReady) {
static_cast<Applet *>(this)->d->uiReady = false;
emit uiReadyChanged(false);
}
}
connect(applet, SIGNAL(configNeedsSaving()), this, SIGNAL(configNeedsSaving()));

View File

@ -284,7 +284,7 @@ void AppletPrivate::setUiReady()
c = q->containment();
if (c) {
q->containment()->d->loadingApplets.remove(q);
if (q->containment()->d->loadingApplets.isEmpty()) {
if (q->containment()->d->loadingApplets.isEmpty() && !static_cast<Applet *>(q->containment())->d->uiReady) {
static_cast<Applet *>(q->containment())->d->uiReady = true;
emit q->containment()->uiReadyChanged(true);
}

View File

@ -73,6 +73,10 @@ KConfigGroup View::config() const
void View::setContainment(Plasma::Containment *cont)
{
if (m_containment.data() == cont) {
return;
}
Plasma::Types::Location oldLoc = (Plasma::Types::Location)location();
Plasma::Types::FormFactor oldForm = formFactor();
@ -85,6 +89,8 @@ void View::setContainment(Plasma::Containment *cont)
}
}
qDebug()<<"AAAAAA"<<cont->title()<<cont->isUiReady();
connect(cont, &Plasma::Containment::uiReadyChanged, [=](bool uiReady){ qDebug()<<"BBBBBBB"<<cont->title()<<cont->isUiReady(); });
m_containment = cont;
if (oldLoc != location()) {