Changeset View
Changeset View
Standalone View
Standalone View
src/main.cpp
Show All 20 Lines | |||||
21 | #include <QGuiApplication> | 21 | #include <QGuiApplication> | ||
22 | #else | 22 | #else | ||
23 | #include <QApplication> | 23 | #include <QApplication> | ||
24 | #endif | 24 | #endif | ||
25 | #include <QQmlApplicationEngine> | 25 | #include <QQmlApplicationEngine> | ||
26 | #include <QtQml> | 26 | #include <QtQml> | ||
27 | #include <QUrl> | 27 | #include <QUrl> | ||
28 | #include <QColor> | 28 | #include <QColor> | ||
29 | #include "Config.h" | ||||
29 | #include "InfoData.h" | 30 | #include "InfoData.h" | ||
30 | 31 | | |||
31 | #ifdef Q_OS_ANDROID | 32 | #ifdef Q_OS_ANDROID | ||
32 | #include <QtAndroid> | 33 | #include <QtAndroid> | ||
33 | 34 | | |||
34 | // WindowManager.LayoutParams | 35 | // WindowManager.LayoutParams | ||
35 | #define FLAG_TRANSLUCENT_STATUS 0x04000000 | 36 | #define FLAG_TRANSLUCENT_STATUS 0x04000000 | ||
36 | #define FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS 0x80000000 | 37 | #define FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS 0x80000000 | ||
Show All 14 Lines | 51 | #else | |||
51 | QApplication app(argc, argv); | 52 | QApplication app(argc, argv); | ||
52 | #endif | 53 | #endif | ||
53 | 54 | | |||
54 | //Extra debug if needed | 55 | //Extra debug if needed | ||
55 | //qputenv("QML_IMPORT_TRACE", "1"); | 56 | //qputenv("QML_IMPORT_TRACE", "1"); | ||
56 | QQmlApplicationEngine engine; | 57 | QQmlApplicationEngine engine; | ||
57 | 58 | | |||
58 | qmlRegisterType<InfoData>("Data", 1, 0, "InfoData"); | 59 | qmlRegisterType<InfoData>("Data", 1, 0, "InfoData"); | ||
60 | qmlRegisterSingletonType<Config>("org.kde.kirigami2.gallery", 1, 0, "GalleryConfig", [](QQmlEngine*,QJSEngine*) -> QObject* {return new Config;}); | ||||
59 | 61 | | |||
60 | //we want different main files on desktop or mobile | 62 | //we want different main files on desktop or mobile | ||
61 | //very small difference as they as they are subclasses of the same thing | 63 | //very small difference as they as they are subclasses of the same thing | ||
62 | if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE") && | 64 | if (qEnvironmentVariableIsSet("QT_QUICK_CONTROLS_MOBILE") && | ||
63 | (QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_MOBILE")) == QStringLiteral("1") || | 65 | (QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_MOBILE")) == QStringLiteral("1") || | ||
64 | QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_MOBILE")) == QStringLiteral("true"))) { | 66 | QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_MOBILE")) == QStringLiteral("true"))) { | ||
65 | engine.load(QUrl(QStringLiteral("qrc:///contents/ui/mobileApp.qml"))); | 67 | engine.load(QUrl(QStringLiteral("qrc:///contents/ui/mobileApp.qml"))); | ||
66 | } else { | 68 | } else { | ||
Show All 20 Lines |