File indexing completed on 2024-05-12 04:42:07

0001 /*
0002     SPDX-FileCopyrightText: 2021 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include <kosmindoormap_version.h>
0008 
0009 #include <KLocalizedContext>
0010 #include <KLocalizedString>
0011 
0012 #include <QQmlApplicationEngine>
0013 #include <QQmlContext>
0014 
0015 #ifdef Q_OS_ANDROID
0016 #include <QGuiApplication>
0017 #include <QQuickStyle>
0018 #else
0019 #include <QApplication>
0020 #endif
0021 
0022 #include <QIcon>
0023 #include <QtPlugin>
0024 
0025 #if HAVE_OSM_PBF_SUPPORT
0026 Q_IMPORT_PLUGIN(OSM_PbfIOPlugin)
0027 #endif
0028 Q_IMPORT_PLUGIN(OSM_XmlIOPlugin)
0029 
0030 #ifdef Q_OS_ANDROID
0031 Q_DECL_EXPORT
0032 #endif
0033 int main(int argc, char **argv)
0034 {
0035     QCoreApplication::setApplicationName(QStringLiteral("kosmindoormap"));
0036     QCoreApplication::setOrganizationName(QStringLiteral("KDE"));
0037     QCoreApplication::setOrganizationDomain(QStringLiteral("kde.org"));
0038     QCoreApplication::setApplicationVersion(QStringLiteral(KOSMINDOORMAP_VERSION_STRING));
0039 
0040 #ifdef Q_OS_ANDROID
0041     QGuiApplication app(argc, argv);
0042     QQuickStyle::setStyle(QStringLiteral("Material"));
0043 #else
0044     QApplication app(argc, argv); // for native file dialogs
0045 #endif
0046     QGuiApplication::setApplicationDisplayName(i18n("KDE OSM Indoor Map"));
0047     QGuiApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("go-home")));
0048 
0049     QQmlApplicationEngine engine;
0050     auto l10nContext = new KLocalizedContext(&engine);
0051     l10nContext->setTranslationDomain(QStringLiteral(TRANSLATION_DOMAIN));
0052     engine.rootContext()->setContextObject(l10nContext);
0053 
0054     engine.load(QStringLiteral("qrc:/indoormap.qml"));
0055     return app.exec();
0056 }