diff --git a/index.pro b/index.pro index c47319b..7924705 100644 --- a/index.pro +++ b/index.pro @@ -1,68 +1,67 @@ QT += qml QT += quick QT += sql CONFIG += c++17 QMAKE_LINK += -nostdlib++ linux:unix:!android { } else:android { message(Building helpers for Android) DEFINES += STATIC_KIRIGAMI #DEFAULT COMPONENTS DEFINITIONS DEFINES *= \ COMPONENT_EDITOR \ COMPONENT_FM \ - COMPONENT_TERMINAL \ COMPONENT_TAGGING \ - COMPONENT_SYNCING + COMPONENT_SYNCING \ + MAUIKIT_STYLE DEFINES -= COMPONENT_STORE + ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_files include($$PWD/3rdparty/kirigami/kirigami.pri) include($$PWD/3rdparty/mauikit/mauikit.pri) - } else { message("Unknown configuration") } # The following define makes your compiler emit warnings if you use # any feature of Qt which as been marked deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ $$PWD/src/main.cpp \ $$PWD/src/index.cpp \ HEADERS += \ $$PWD/src/index.h \ $$PWD/src/inx.h \ RESOURCES += \ $$PWD/src/qml.qrc \ $$PWD/src/index_assets.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target include($$PWD/install.pri) -ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android_files diff --git a/src/main.cpp b/src/main.cpp index 4101e61..1c06f26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,90 +1,90 @@ #include #include #include #include #include #include "index.h" #include "inx.h" -#if defined APPIMAGE_PACKAGE || defined MAUIKIT_STYLE +#if defined APPIMAGE_PACKAGE && defined MAUIKIT_STYLE #include #endif #ifdef Q_OS_ANDROID #include #include #include "mauiandroid.h" #else #include #endif #ifdef STATIC_KIRIGAMI #include "3rdparty/kirigami/src/kirigamiplugin.h" #endif #ifdef STATIC_MAUIKIT #include "3rdparty/mauikit/src/mauikit.h" #endif Q_DECL_EXPORT int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); #ifdef Q_OS_ANDROID QGuiApplication app(argc, argv); if (!MAUIAndroid::checkRunTimePermissions()) return -1; #else QApplication app(argc, argv); #endif #ifdef MAUIKIT_STYLE MauiKit::getInstance().initResources(); #endif app.setApplicationName(INX::appName); app.setApplicationVersion(INX::version); app.setApplicationDisplayName(INX::displayName); app.setOrganizationName(INX::orgName); app.setOrganizationDomain(INX::orgDomain); app.setWindowIcon(QIcon(":/index.png")); QCommandLineParser parser; parser.setApplicationDescription(INX::description); const QCommandLineOption versionOption = parser.addVersionOption(); parser.addOption(versionOption); parser.process(app); const QStringList args = parser.positionalArguments(); QStringList paths; if(!args.isEmpty()) paths = args; #ifdef STATIC_KIRIGAMI KirigamiPlugin::getInstance().registerTypes(); #endif #ifdef STATIC_MAUIKIT MauiKit::getInstance().registerTypes(); #endif Index index; QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, &app, [url, paths, &index](QObject *obj, const QUrl &objUrl) { if (!obj && url == objUrl) QCoreApplication::exit(-1); if(!paths.isEmpty()) index.openPaths(paths); }, Qt::QueuedConnection); const auto context = engine.rootContext(); context->setContextProperty("inx", &index); engine.load(url); return app.exec(); }