From 7292938520c3d7b0828e5d313bb970287dafa4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Mon, 26 May 2014 11:32:52 +0200 Subject: [PATCH] [kcmkwin/compositing] Improve initialization of kdeclarative We need kdeclarative for i18n support. This needs to be done before we load the source. By that we don't need to import Plasma.Core which isn't used by the views at all. Also we don't need to link twice against declarative. --- kcmkwin/kwincompositing/CMakeLists.txt | 2 -- kcmkwin/kwincompositing/main.cpp | 4 ---- kcmkwin/kwincompositing/model.cpp | 4 ++++ kcmkwin/kwincompositing/qml/CompositingView.qml | 1 - kcmkwin/kwincompositing/qml/EffectView.qml | 1 - kcmkwin/kwincompositing/qml/OpenGLErrorView.qml | 2 -- 6 files changed, 4 insertions(+), 10 deletions(-) diff --git a/kcmkwin/kwincompositing/CMakeLists.txt b/kcmkwin/kwincompositing/CMakeLists.txt index afc70f413e..6e78187716 100644 --- a/kcmkwin/kwincompositing/CMakeLists.txt +++ b/kcmkwin/kwincompositing/CMakeLists.txt @@ -39,7 +39,6 @@ target_link_libraries(kwincompositing KF5::Service KF5::KCMUtils KF5::NewStuff - KF5::Declarative kwin4_effect_builtins ) @@ -71,7 +70,6 @@ target_link_libraries(effectModelTest KF5::Service KF5::KCMUtils KF5::NewStuff - KF5::Declarative kwin4_effect_builtins ) diff --git a/kcmkwin/kwincompositing/main.cpp b/kcmkwin/kwincompositing/main.cpp index 5aed7d08d9..1c1dc4e6f9 100644 --- a/kcmkwin/kwincompositing/main.cpp +++ b/kcmkwin/kwincompositing/main.cpp @@ -27,7 +27,6 @@ #include #include -#include class KWinCompositingKCM : public KCModule { @@ -68,9 +67,6 @@ KWinCompositingKCM::KWinCompositingKCM(QWidget* parent, const QVariantList& args : KCModule(parent, args) , m_view(new KWin::Compositing::EffectView(viewType)) { - KDeclarative::KDeclarative kdeclarative; - kdeclarative.setDeclarativeEngine(m_view->engine()); - kdeclarative.setupBindings(); QVBoxLayout *vl = new QVBoxLayout(this); QWidget *w = QWidget::createWindowContainer(m_view.data(), this); diff --git a/kcmkwin/kwincompositing/model.cpp b/kcmkwin/kwincompositing/model.cpp index 889c22f193..44364d9e21 100644 --- a/kcmkwin/kwincompositing/model.cpp +++ b/kcmkwin/kwincompositing/model.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -511,6 +512,9 @@ EffectView::EffectView(ViewType type, QWindow *parent) void EffectView::init(ViewType type) { + KDeclarative::KDeclarative kdeclarative; + kdeclarative.setDeclarativeEngine(engine()); + kdeclarative.setupBindings(); QString path; switch (type) { case CompositingSettingsView: diff --git a/kcmkwin/kwincompositing/qml/CompositingView.qml b/kcmkwin/kwincompositing/qml/CompositingView.qml index 0899c52b37..6d50322727 100644 --- a/kcmkwin/kwincompositing/qml/CompositingView.qml +++ b/kcmkwin/kwincompositing/qml/CompositingView.qml @@ -23,7 +23,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kwin.kwincompositing 1.0 -import org.kde.plasma.core 2.0 Item { signal changed diff --git a/kcmkwin/kwincompositing/qml/EffectView.qml b/kcmkwin/kwincompositing/qml/EffectView.qml index 4591ca432e..4db0818273 100644 --- a/kcmkwin/kwincompositing/qml/EffectView.qml +++ b/kcmkwin/kwincompositing/qml/EffectView.qml @@ -22,7 +22,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 import org.kde.kwin.kwincompositing 1.0 -import org.kde.plasma.core 2.0 Item { signal changed diff --git a/kcmkwin/kwincompositing/qml/OpenGLErrorView.qml b/kcmkwin/kwincompositing/qml/OpenGLErrorView.qml index b54d17c840..ac9bd82d2a 100644 --- a/kcmkwin/kwincompositing/qml/OpenGLErrorView.qml +++ b/kcmkwin/kwincompositing/qml/OpenGLErrorView.qml @@ -21,8 +21,6 @@ import QtQuick 2.1 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.0 -// for i18n -import org.kde.plasma.core 2.0 Item { id: openGLErrorView