[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.
This commit is contained in:
Martin Gräßlin 2014-05-26 11:32:52 +02:00
parent 5d4ddbf01c
commit 7292938520
6 changed files with 4 additions and 10 deletions

View file

@ -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
)

View file

@ -27,7 +27,6 @@
#include <kcmodule.h>
#include <kservice.h>
#include <kdeclarative/kdeclarative.h>
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);

View file

@ -32,6 +32,7 @@
#include <KSharedConfig>
#include <KCModuleProxy>
#include <KPluginTrader>
#include <kdeclarative/kdeclarative.h>
#include <QAbstractItemModel>
#include <QDBusConnection>
@ -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:

View file

@ -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

View file

@ -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

View file

@ -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