diff --git a/src/plasmaquick/appletquickitem.cpp b/src/plasmaquick/appletquickitem.cpp index a0dbf5ed2..49b825c01 100644 --- a/src/plasmaquick/appletquickitem.cpp +++ b/src/plasmaquick/appletquickitem.cpp @@ -183,7 +183,7 @@ QObject *AppletQuickItemPrivate::createFullRepresentationItem() return fullRepresentationItem.data(); } - if (fullRepresentation) { + if (fullRepresentation && fullRepresentation.data() != qmlObject->mainComponent()) { fullRepresentationItem = qmlObject->createObjectFromComponent(fullRepresentation.data(), QtQml::qmlContext(qmlObject->rootObject())); } else { fullRepresentation = qmlObject->mainComponent(); @@ -191,6 +191,11 @@ QObject *AppletQuickItemPrivate::createFullRepresentationItem() emit q->fullRepresentationChanged(fullRepresentation.data()); } + + if (!fullRepresentationItem) { + return 0; + } + QQuickItem *graphicsObj = qobject_cast(fullRepresentationItem.data()); QObject::connect (graphicsObj, &QQuickItem::widthChanged, [=]() { fullRepresentationResizeTimer.start(); @@ -435,7 +440,7 @@ Plasma::Applet *AppletQuickItem::applet() const void AppletQuickItem::init() { - if (AppletQuickItemPrivate::s_rootObjects.contains(this)) { + if (AppletQuickItemPrivate::s_rootObjects.contains(d->qmlObject->engine())) { return; }