diff --git a/shell/containmentconfigview.cpp b/shell/containmentconfigview.cpp index bf2b9287a..3ae29859e 100644 --- a/shell/containmentconfigview.cpp +++ b/shell/containmentconfigview.cpp @@ -56,7 +56,7 @@ ContainmentConfigView::ContainmentConfigView(Plasma::Containment *cont, QWindow m_ownWallpaperConfig(0) { qmlRegisterType(); - engine()->rootContext()->setContextProperty(QStringLiteral("configDialog"), this); + rootContext()->setContextProperty(QStringLiteral("configDialog"), this); setCurrentWallpaper(cont->containment()->wallpaper()); KPackage::Package pkg = KPackage::PackageLoader::self()->loadPackage(QStringLiteral("Plasma/Wallpaper")); @@ -237,7 +237,7 @@ void ContainmentConfigView::syncWallpaperObjects() if (!wallpaperGraphicsObject) { return; } - engine()->rootContext()->setContextProperty(QStringLiteral("wallpaper"), wallpaperGraphicsObject); + rootContext()->setContextProperty(QStringLiteral("wallpaper"), wallpaperGraphicsObject); //FIXME: why m_wallpaperGraphicsObject->property("configuration").value() doesn't work? m_currentWallpaperConfig = static_cast(wallpaperGraphicsObject->property("configuration").value()); diff --git a/shell/panelconfigview.cpp b/shell/panelconfigview.cpp index 29a50bc03..bc4a1d953 100644 --- a/shell/panelconfigview.cpp +++ b/shell/panelconfigview.cpp @@ -79,8 +79,8 @@ PanelConfigView::PanelConfigView(Plasma::Containment *containment, PanelView *pa updateContrast(); connect(&m_theme, &Plasma::Theme::themeChanged, this, &PanelConfigView::updateContrast); - engine()->rootContext()->setContextProperty(QStringLiteral("panel"), panelView); - engine()->rootContext()->setContextProperty(QStringLiteral("configDialog"), this); + rootContext()->setContextProperty(QStringLiteral("panel"), panelView); + rootContext()->setContextProperty(QStringLiteral("configDialog"), this); connect(containment, &Plasma::Containment::formFactorChanged, this, &PanelConfigView::syncGeometry); connect(containment, &Plasma::Containment::locationChanged, this, &PanelConfigView::syncSlideLocation); diff --git a/shell/panelview.cpp b/shell/panelview.cpp index 893def0ce..58129c05b 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -110,7 +110,7 @@ PanelView::PanelView(ShellCorona *corona, QScreen *targetScreen, QWindow *parent this, &PanelView::updateStruts); qmlRegisterType(); - engine()->rootContext()->setContextProperty(QStringLiteral("panel"), this); + rootContext()->setContextProperty(QStringLiteral("panel"), this); setSource(QUrl::fromLocalFile(m_corona->kPackage().filePath("views", QStringLiteral("Panel.qml")))); PanelShadows::self()->addWindow(this); } diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index 17ce61b57..762e503bf 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -510,7 +510,7 @@ void ShellCorona::showAlternativesForApplet(Plasma::Applet *applet) qmlObj->setSource(QUrl::fromLocalFile(alternativesQML)); AlternativesHelper *helper = new AlternativesHelper(applet, qmlObj); - qmlObj->engine()->rootContext()->setContextProperty(QStringLiteral("alternativesHelper"), helper); + qmlObj->rootContext()->setContextProperty(QStringLiteral("alternativesHelper"), helper); m_alternativesObjects << qmlObj; qmlObj->completeInitialization(); @@ -1152,7 +1152,7 @@ void ShellCorona::showInteractiveConsole() m_interactiveConsole->setSource(QUrl::fromLocalFile(consoleQML)); QObject *engine = new WorkspaceScripting::ScriptEngine(this, m_interactiveConsole); - m_interactiveConsole->engine()->rootContext()->setContextProperty(QStringLiteral("scriptEngine"), engine); + m_interactiveConsole->rootContext()->setContextProperty(QStringLiteral("scriptEngine"), engine); m_interactiveConsole->completeInitialization(); if (m_interactiveConsole->rootObject()) {