ensure empty containment emit uiReady()

Containments with no applets will emit uiReady now

It adds a test as well that checks if this is the case.

There is still a case where the corona doesn't emit startupCompleted()
that's when there is more than one activity, but that, as well the test
will be adressed by another patch on a different part.

Change-Id: I4d83aa612c29fb0f441d11681bc5aba241370bc3
This commit is contained in:
Marco Martin 2014-09-13 12:20:34 +02:00
parent 72caf0b9f0
commit 0b0daa2318
4 changed files with 10 additions and 3 deletions

View File

@ -129,7 +129,7 @@ void CoronaTest::cleanupTestCase()
void CoronaTest::restore()
{
m_corona->loadLayout("plasma-test-appletsrc");
QCOMPARE(m_corona->containments().count(), 1);
QCOMPARE(m_corona->containments().count(), 2);
QCOMPARE(m_corona->containments().first()->applets().count(), 2);
}

View File

@ -14,5 +14,13 @@ plugin=invalid
immutability=1
plugin=simpleapplet
#empty panel: should emit complete even if empty
[Containments][4]
formfactor=2
immutability=1
lastScreen=0
location=4
plugin=simplecontainment
[General]
immutability=1

View File

@ -563,7 +563,6 @@ QList<Plasma::Containment *> CoronaPrivate::importLayout(const KConfigGroup &con
if (!ready) {
return;
}
--containmentsStarting;
if (containmentsStarting <= 0) {
emit q->startupCompleted();

View File

@ -246,7 +246,7 @@ void ContainmentPrivate::setUiReady()
//if we are the containment and there is still some uncomplete applet, we're still incomplete
if (!uiReady) {
uiReady = true;
if (q->Applet::d->started && appletsUiReady && loadingApplets.isEmpty()) {
if (q->Applet::d->started && (appletsUiReady || applets.isEmpty()) && loadingApplets.isEmpty()) {
emit q->uiReadyChanged(true);
}
}