Commit 5336e5e8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Use directly KI18n for exposing i18n()

parent e9f99075
add_subdirectory(plugins) add_subdirectory(plugins)
if(KDeclarative_FOUND) if(KF5I18n_FOUND)
add_definitions(-DKDECOMPONENTS) add_definitions(-DKDECOMPONENTS)
endif() endif()
...@@ -19,8 +19,8 @@ elseif(${MOBILE_BACKEND} STREQUAL "material") ...@@ -19,8 +19,8 @@ elseif(${MOBILE_BACKEND} STREQUAL "material")
# if we don't link it here explicitly, androiddeployqt doesn't bring it # if we don't link it here explicitly, androiddeployqt doesn't bring it
find_package(Qt5Svg REQUIRED) find_package(Qt5Svg REQUIRED)
target_link_libraries(kalgebramobile Qt5::Svg) target_link_libraries(kalgebramobile Qt5::Svg)
elseif(KDeclarative_FOUND) elseif(KF5I18n_FOUND)
target_link_libraries(kalgebramobile KF5::KDeclarative) target_link_libraries(kalgebramobile KF5::I18n)
endif() endif()
set(DESKTOPFILE kalgebramobile.desktop) set(DESKTOPFILE kalgebramobile.desktop)
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
#include <QGuiApplication> #include <QGuiApplication>
#ifdef KDECOMPONENTS #ifdef KDECOMPONENTS
#include <kdeclarative/kdeclarative.h> #include <KLocalizedContext>
#endif #endif
#include <QDebug> #include <QDebug>
...@@ -47,14 +47,6 @@ int main(int argc, char *argv[]) ...@@ -47,14 +47,6 @@ int main(int argc, char *argv[])
KAlgebraMobile widget; KAlgebraMobile widget;
#ifdef KDECOMPONENTS
KDeclarative kdeclarative;
// kdeclarative.setDeclarativeEngine(view.engine());
// kdeclarative.initialize();
//binds things like kconfig and icons
// kdeclarative.setupBindings();
#endif
QString main = PluginsModel::pluginsDirectoryPath()+"/widgets/KAlgebraMobile.qml"; QString main = PluginsModel::pluginsDirectoryPath()+"/widgets/KAlgebraMobile.qml";
QDir dir = QFileInfo(main).dir(); QDir dir = QFileInfo(main).dir();
...@@ -63,7 +55,11 @@ int main(int argc, char *argv[]) ...@@ -63,7 +55,11 @@ int main(int argc, char *argv[])
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("app"), &widget); engine.rootContext()->setContextProperty(QStringLiteral("app"), &widget);
engine.addImportPath(dir.path()); engine.addImportPath(dir.path());
engine.load(QUrl::fromLocalFile(main));
#ifdef KDECOMPONENTS
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
#endif
engine.load(QUrl::fromLocalFile(main));
return app.exec(); return app.exec();
} }
Markdown is supported
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