if an applet is invalid, it has immediately UiReadyConstraint

Summary:
mirroring the behavior when the applet is created by restorecontents,
invalid applets get immediately uireadyconstraint.
This solves the problem of panels not appearing when the setup js contains an non existent applet,
as the panel was waiting forever for applets to finish loading, which never happens

Test Plan: now js startup scripts with an invalid applet have panels loading correctly.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: davidedmundson, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D14341
This commit is contained in:
Marco Martin 2018-07-26 13:09:59 +02:00
parent af01c2e953
commit 56f0df4127

View File

@ -208,6 +208,10 @@ Applet *ContainmentPrivate::createApplet(const QString &name, const QVariantList
}
q->addApplet(applet);
//mirror behavior of resorecontents: if an applet is not valid, set it immediately to uiReady
if (!applet->pluginMetaData().isValid()) {
applet->updateConstraints(Plasma::Types::UiReadyConstraint);
}
return applet;
}