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

mobile: Fix startup

parent 9ba932d0
...@@ -46,6 +46,7 @@ KAlgebraMobile::KAlgebraMobile(QObject* parent) ...@@ -46,6 +46,7 @@ KAlgebraMobile::KAlgebraMobile(QObject* parent)
qmlRegisterType<PluginsModel>("org.kde.kalgebra.mobile", 1, 0, "PluginsModel"); qmlRegisterType<PluginsModel>("org.kde.kalgebra.mobile", 1, 0, "PluginsModel");
qmlRegisterType<ConsoleModel>("org.kde.kalgebra.mobile", 1, 0, "ConsoleModel"); qmlRegisterType<ConsoleModel>("org.kde.kalgebra.mobile", 1, 0, "ConsoleModel");
qmlRegisterType<QSortFilterProxyModel>("org.kde.kalgebra.mobile", 1, 0, "QSortFilterProxyModel"); qmlRegisterType<QSortFilterProxyModel>("org.kde.kalgebra.mobile", 1, 0, "QSortFilterProxyModel");
qmlRegisterUncreatableType<QAbstractItemModel>("org.kde.kalgebra.mobile", 1, 0, "QAbstractItemModel", "no");
qmlRegisterType<Clipboard>(uri, 1, 0, "Clipboard"); qmlRegisterType<Clipboard>(uri, 1, 0, "Clipboard");
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0) #if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
......
...@@ -46,7 +46,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) ...@@ -46,7 +46,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
KLocalizedString::setApplicationDomain("kalgebramobile"); KLocalizedString::setApplicationDomain("kalgebramobile");
KAboutData about(QStringLiteral("kalgebramobile"), QStringLiteral("KAlgebra"), QStringLiteral(KALGEBRA_VERSION_STRING), i18n("A portable calculator"), KAboutData about(QStringLiteral("kalgebramobile"), QStringLiteral("KAlgebra"), QStringLiteral(KALGEBRA_VERSION_STRING), i18n("A portable calculator"),
KAboutLicense::GPL, i18n("(C) 2006-2018 Aleix Pol i Gonzalez")); KAboutLicense::GPL, i18n("(C) 2006-2020 Aleix Pol i Gonzalez"));
about.addAuthor( QStringLiteral("Aleix Pol i Gonzalez"), QString(), QStringLiteral("aleixpol@kde.org") ); about.addAuthor( QStringLiteral("Aleix Pol i Gonzalez"), QString(), QStringLiteral("aleixpol@kde.org") );
about.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails")); about.setTranslator(i18nc("NAME OF TRANSLATORS", "Your names"), i18nc("EMAIL OF TRANSLATORS", "Your emails"));
KAboutData::setApplicationData(about); KAboutData::setApplicationData(about);
...@@ -60,14 +60,15 @@ Q_DECL_EXPORT int main(int argc, char *argv[]) ...@@ -60,14 +60,15 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
KAlgebraMobile widget; KAlgebraMobile widget;
QString widgetsDir = PluginsModel::pluginsDirectoryPath()+"/widgets"; const QString pluginsDir = PluginsModel::pluginsDirectoryPath();
QQmlApplicationEngine engine; QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("app"), &widget); engine.rootContext()->setContextProperty(QStringLiteral("app"), &widget);
engine.addImportPath(widgetsDir); engine.addImportPath(pluginsDir);
engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.load(QUrl::fromLocalFile(widgetsDir + QStringLiteral("/KAlgebraMobile.qml"))); engine.load(QUrl::fromLocalFile(pluginsDir + QStringLiteral("/widgets/KAlgebraMobile.qml")));
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