From 07ae9bbc4608700f7fd1fb6c2fba274923b9b794 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Mon, 31 Oct 2016 14:34:49 +0100 Subject: [PATCH] set context proeprties before reloading the qml doing setSource then immediately after rootContext()->setContextProperty makes the property binding evaluated right at startup to be broken, also fail any access to said contextproperty until the point of Conponent.onCompleted BUG:371763 Change-Id: Ie10afcf3c5b1693db49b5c240c9d2a4f3c47db21 --- src/scriptengines/qml/plasmoid/wallpaperinterface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp index 559f50919..a4f8e8ba2 100644 --- a/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp +++ b/src/scriptengines/qml/plasmoid/wallpaperinterface.cpp @@ -148,8 +148,8 @@ void WallpaperInterface::syncWallpaperPackage() m_configuration = new KDeclarative::ConfigPropertyMap(configScheme(), this); } - m_qmlObject->setSource(QUrl::fromLocalFile(m_pkg.filePath("mainscript"))); m_qmlObject->rootContext()->setContextProperty(QStringLiteral("wallpaper"), this); + m_qmlObject->setSource(QUrl::fromLocalFile(m_pkg.filePath("mainscript"))); const QString rootPath = m_pkg.metadata().property(QStringLiteral("X-Plasma-RootPath")).toString(); if (!rootPath.isEmpty()) {