Fix deprecation warning

Test Plan: App still starts

Reviewers: #kde_connect, sredman

Reviewed By: #kde_connect, sredman

Subscribers: sredman, kdeconnect

Tags: #kde_connect

Differential Revision: https://phabricator.kde.org/D16626
This commit is contained in:
Nicolas Fella 2018-11-07 16:06:16 +01:00
parent a685a4910e
commit ae53c9c0bf

View file

@ -21,9 +21,10 @@
#include <QApplication> #include <QApplication>
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QCommandLineParser> #include <QCommandLineParser>
#include <KDeclarative/KDeclarative>
#include <KAboutData> #include <KAboutData>
#include <KLocalizedString> #include <KLocalizedString>
#include <KLocalizedContext>
#include <QtQml>
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@ -42,11 +43,7 @@ int main(int argc, char* argv[])
} }
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(&engine);
kdeclarative.setupBindings();
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml"))); engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
return app.exec(); return app.exec();