Commit fc13ffb8 authored by Volker Krause's avatar Volker Krause
Browse files

Port away from deprecated KDeclarative API

parent 94c0c3c2
Pipeline #166897 passed with stage
in 7 minutes and 53 seconds
......@@ -8,6 +8,7 @@
#include "../configcontainer.h"
#include <KAboutData>
#include <KLocalizedContext>
#include <KLocalizedString>
#include <KMessageWidget>
#include <kdeclarative/kdeclarative.h>
......@@ -65,10 +66,8 @@ LibinputConfig::LibinputConfig(ConfigContainer *parent, InputBackend *backend)
m_view->rootContext()->setContextProperty("backend", m_backend);
m_view->rootContext()->setContextProperty("deviceModel", getDeviceList(m_backend));
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setupEngine(m_view->engine()); // This is a new engine
kdeclarative.setDeclarativeEngine(m_view->engine());
kdeclarative.setupContext();
KDeclarative::KDeclarative::setupEngine(m_view->engine()); // This is a new engine
m_view->engine()->rootContext()->setContextObject(new KLocalizedContext(m_view->engine()));
if (m_backend->mode() == InputBackendMode::XLibinput) {
m_view->setSource(QUrl(QStringLiteral("qrc:/libinput/main_deviceless.qml")));
......
......@@ -7,6 +7,7 @@
#include "touchpadconfiglibinput.h"
#include <KAboutData>
#include <KLocalizedContext>
#include <KLocalizedString>
#include <kdeclarative/kdeclarative.h>
......@@ -55,9 +56,8 @@ TouchpadConfigLibinput::TouchpadConfigLibinput(TouchpadConfigContainer *parent,
qmlRegisterSingletonInstance("org.kde.touchpad.kcm", 1, 0, "TouchpadConfig", this);
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(m_view->engine());
kdeclarative.setupBindings();
KDeclarative::KDeclarative::setupEngine(m_view->engine());
m_view->engine()->rootContext()->setContextObject(new KLocalizedContext(m_view->engine()));
m_view->setSource(QUrl("qrc:/libinput/touchpad.qml"));
if (m_initError) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment