Changeset View
Changeset View
Standalone View
Standalone View
src/scriptengines/qml/plasmoid/appletinterface.cpp
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | 160 | { | |||
---|---|---|---|---|---|
164 | 164 | | |||
165 | m_configuration = new KDeclarative::ConfigPropertyMap(applet()->configScheme(), this); | 165 | m_configuration = new KDeclarative::ConfigPropertyMap(applet()->configScheme(), this); | ||
166 | 166 | | |||
167 | AppletQuickItem::init(); | 167 | AppletQuickItem::init(); | ||
168 | 168 | | |||
169 | geometryChanged(QRectF(), QRectF(x(), y(), width(), height())); | 169 | geometryChanged(QRectF(), QRectF(x(), y(), width(), height())); | ||
170 | emit busyChanged(); | 170 | emit busyChanged(); | ||
171 | 171 | | |||
172 | if (m_loadingRef == 0) { | ||||
broulik: In my case this code path is hit before any of the QML property assignments or `Component. | |||||
172 | applet()->updateConstraints(Plasma::Types::UiReadyConstraint); | 173 | applet()->updateConstraints(Plasma::Types::UiReadyConstraint); | ||
174 | } | ||||
173 | 175 | | |||
174 | connect(applet(), &Plasma::Applet::activated, this, | 176 | connect(applet(), &Plasma::Applet::activated, this, | ||
175 | [ = ]() { | 177 | [ = ]() { | ||
176 | // in case the applet doesn't want to get shrinked on reactivation, | 178 | // in case the applet doesn't want to get shrinked on reactivation, | ||
177 | // we always expand it again (only in order to conform with legacy behaviour) | 179 | // we always expand it again (only in order to conform with legacy behaviour) | ||
178 | bool activate = !( isExpanded() && isActivationTogglesExpanded() ); | 180 | bool activate = !( isExpanded() && isActivationTogglesExpanded() ); | ||
179 | 181 | | |||
180 | setExpanded(activate); | 182 | setExpanded(activate); | ||
▲ Show 20 Lines • Show All 665 Lines • ▼ Show 20 Line(s) | 807 | if (c) { | |||
846 | delete desktopMenu; | 848 | delete desktopMenu; | ||
847 | return false; | 849 | return false; | ||
848 | } | 850 | } | ||
849 | } | 851 | } | ||
850 | 852 | | |||
851 | return AppletQuickItem::eventFilter(watched, event); | 853 | return AppletQuickItem::eventFilter(watched, event); | ||
852 | } | 854 | } | ||
853 | 855 | | |||
856 | QVariant AppletInterface::createUiReadyInhibitor() | ||||
857 | { | ||||
858 | m_loadingRef++; | ||||
859 | auto cookie = QSharedPointer<QObject>::create(this); | ||||
860 | connect(cookie.data(), &QObject::destroyed, this, [this]() { | ||||
861 | m_loadingRef--; | ||||
862 | if (m_loadingRef == 0) { | ||||
863 | applet()->updateConstraints(Plasma::Types::UiReadyConstraint); | ||||
864 | } | ||||
865 | }); | ||||
866 | return QVariant::fromValue(cookie); | ||||
867 | } | ||||
868 | | ||||
854 | 869 | | |||
855 | #include "moc_appletinterface.cpp" | 870 | #include "moc_appletinterface.cpp" |
In my case this code path is hit before any of the QML property assignments or Component.onCompletd are executed. I don't really understand why given AppletQuickItem::init() does forceCompletion()