don't assume last is is numScreens()-1

screen ids are going to not be continuous anymore
as screen id is going to correspond 1:1 to connectors,
it will be possible to have "holes", therefore valid ids
that are bigger than screenNum()

REVIEWED-BY:sebas@kde.org
Change-Id: I1c0b1fb827dba4d95f228d32209403150c089c77
This commit is contained in:
Marco Martin 2016-07-18 14:43:03 +02:00
parent 14dc19e1bd
commit 301193cb96

View File

@ -211,7 +211,7 @@ Containment *Corona::containmentForScreen(int screen,
Containment *containment = containmentForScreen(screen); Containment *containment = containmentForScreen(screen);
if (!containment && !defaultPluginIfNonExistent.isEmpty()) { if (!containment && !defaultPluginIfNonExistent.isEmpty()) {
// screen requests are allowed to bypass immutability // screen requests are allowed to bypass immutability
if (screen >= 0 && screen < numScreens()) { if (screen >= 0) {
Plasma::Types::ImmutabilityType imm = d->immutability; Plasma::Types::ImmutabilityType imm = d->immutability;
d->immutability = Types::Mutable; d->immutability = Types::Mutable;
containment = d->addContainment(defaultPluginIfNonExistent, defaultArgs, 0, false); containment = d->addContainment(defaultPluginIfNonExistent, defaultArgs, 0, false);
@ -598,7 +598,7 @@ void CoronaPrivate::notifyContainmentsReady()
{ {
containmentsStarting = 0; containmentsStarting = 0;
foreach (Containment *containment, containments) { foreach (Containment *containment, containments) {
if (!containment->isUiReady() && containment->screen() < q->numScreens() && containment->screen() >= 0) { if (!containment->isUiReady() && containment->screen() >= 0) {
++containmentsStarting; ++containmentsStarting;
QObject::connect(containment, &Plasma::Containment::uiReadyChanged, q, [this](bool ready) { containmentReady(ready); } ); QObject::connect(containment, &Plasma::Containment::uiReadyChanged, q, [this](bool ready) { containmentReady(ready); } );
} }