don't expand if still creating the representation
when qml object gets created with an async incubator, events are still processed, so we have to guard gainst double triggers that can lead to creating the extended representation again BUG:335406
This commit is contained in:
parent
aab2c13164
commit
c3a38d3434
@ -48,7 +48,8 @@ AppletQuickItemPrivate::AppletQuickItemPrivate(Plasma::Applet *a, AppletQuickIte
|
||||
switchWidth(-1),
|
||||
switchHeight(-1),
|
||||
applet(a),
|
||||
expanded(false)
|
||||
expanded(false),
|
||||
creatingFullRepresentation(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -184,7 +185,9 @@ QObject *AppletQuickItemPrivate::createFullRepresentationItem()
|
||||
}
|
||||
|
||||
if (fullRepresentation && fullRepresentation.data() != qmlObject->mainComponent()) {
|
||||
creatingFullRepresentation = true;
|
||||
fullRepresentationItem = qmlObject->createObjectFromComponent(fullRepresentation.data(), QtQml::qmlContext(qmlObject->rootObject()));
|
||||
creatingFullRepresentation = false;
|
||||
} else {
|
||||
fullRepresentation = qmlObject->mainComponent();
|
||||
fullRepresentationItem = qmlObject->rootObject();
|
||||
@ -625,6 +628,10 @@ bool AppletQuickItem::isExpanded() const
|
||||
|
||||
void AppletQuickItem::setExpanded(bool expanded)
|
||||
{
|
||||
if (d->creatingFullRepresentation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (d->applet->isContainment()) {
|
||||
expanded = true;
|
||||
}
|
||||
|
@ -101,6 +101,7 @@ public:
|
||||
Plasma::Package coronaPackage;
|
||||
|
||||
bool expanded : 1;
|
||||
bool creatingFullRepresentation : 1;
|
||||
|
||||
static QHash<QObject *, AppletQuickItem *> s_rootObjects;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user