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

simplify code

parent 0ecfeb72
......@@ -60,17 +60,14 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
KAlgebraMobile widget;
QString main = PluginsModel::pluginsDirectoryPath()+"/widgets/KAlgebraMobile.qml";
QDir dir = QFileInfo(main).dir();
dir.cdUp();
QString widgetsDir = PluginsModel::pluginsDirectoryPath()+"/widgets";
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("app"), &widget);
engine.addImportPath(dir.path());
engine.addImportPath(widgetsDir);
engine.rootContext()->setContextObject(new KLocalizedContext(&engine));
engine.load(QUrl::fromLocalFile(main));
engine.load(QUrl::fromLocalFile(widgetsDir + QStringLiteral("/KAlgebraMobile.qml")));
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