diff --git a/CMakeLists.txt b/CMakeLists.txt index 198c7d24..35e2e742 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,151 +1,151 @@ cmake_minimum_required(VERSION 3.5) project(elisa) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD 14) set(REQUIRED_QT_VERSION "5.9.0") find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG REQUIRED Core Network Qml Quick Test Sql Multimedia Svg Gui Widgets QuickTest Concurrent) set(REQUIRED_KF5_VERSION "5.41.0") find_package(ECM ${REQUIRED_KF5_VERSION} REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE) include(ECMInstallIcons) include(FeatureSummary) include(ECMAddAppIcon) include(ECMAddTests) find_package(Qt5DBus ${REQUIRED_QT_VERSION} CONFIG QUIET) set_package_properties(Qt5DBus PROPERTIES DESCRIPTION "Qt5 DBus is needed to provide MPris2 interface to allow remote control by the desktop workspace." TYPE OPTIONAL) find_package(Qt5QuickWidgets ${REQUIRED_QT_VERSION} CONFIG QUIET) set_package_properties(Qt5QuickWidgets PROPERTIES DESCRIPTION "Qt5 Quick Widgets is needed at runtime to provide the interface." TYPE RUNTIME) find_package(Qt5QuickControls2 ${REQUIRED_QT_VERSION} CONFIG QUIET) set_package_properties(Qt5QuickControls2 PROPERTIES DESCRIPTION "Qt5 Quick Controls version 2 is needed at runtime to provide the interface." - TYPE REQUIRED) + TYPE RUNTIME) if (ANDROID) find_package(Qt5 ${REQUIRED_QT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS AndroidExtras) endif() find_package(KF5I18n ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5I18n PROPERTIES DESCRIPTION "KF5 text internationalization library." TYPE REQUIRED) find_package(KF5Declarative ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5Declarative PROPERTIES DESCRIPTION "Integration of QML and KDE work spaces." TYPE RECOMMENDED) find_package(KF5CoreAddons ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5CoreAddons PROPERTIES DESCRIPTION "Qt addon library with a collection of non-GUI utilities." TYPE REQUIRED) find_package(KF5Baloo ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5Baloo PROPERTIES DESCRIPTION "Baloo provides file searching and indexing." TYPE RECOMMENDED) find_package(KF5FileMetaData ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5FileMetaData PROPERTIES DESCRIPTION "Provides a simple library for extracting metadata." TYPE REQUIRED) find_package(KF5DocTools ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5DocTools PROPERTIES DESCRIPTION "Create documentation from DocBook library." TYPE OPTIONAL) find_package(KF5XmlGui ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5XmlGui PROPERTIES DESCRIPTION "Framework for managing menu and toolbar actions." TYPE RECOMMENDED) find_package(KF5Config ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5Config PROPERTIES DESCRIPTION "Persistent platform-independent application settings." TYPE REQUIRED) find_package(KF5ConfigWidgets ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5ConfigWidgets PROPERTIES DESCRIPTION "Widgets for configuration dialogs." TYPE RECOMMENDED) find_package(KF5Crash ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5Crash PROPERTIES DESCRIPTION "Graceful handling of application crashes." TYPE OPTIONAL) find_package(KF5DBusAddons ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5DBusAddons PROPERTIES DESCRIPTION "Convenience classes for D-Bus." TYPE OPTIONAL) find_package(KF5KCMUtils ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5KCMUtils PROPERTIES DESCRIPTION "KF5 Utilities for KDE System Settings modules library." TYPE RECOMMENDED) find_package(KF5Package ${REQUIRED_KF5_VERSION} CONFIG QUIET) set_package_properties(KF5Package PROPERTIES DESCRIPTION "KF5 package management library needed to get the configuration dialogs." TYPE RECOMMENDED) find_package(UPNPQT CONFIG QUIET) set_package_properties(UPNPQT PROPERTIES DESCRIPTION "UPNP layer build with Qt 5. UPnP support is currently broken. You should probably avoid this dependency." URL "https://gitlab.com/homeautomationqt/upnp-player-qt" TYPE OPTIONAL) if (UPNPQT_FOUND) message(WARNING "UPnP support is experimental and may not work.") endif() include(FeatureSummary) include(GenerateExportHeader) include(ECMSetupVersion) include(ECMGenerateHeaders) include(CMakePackageConfigHelpers) if (CMAKE_SYSTEM_NAME STREQUAL Android) set(QT_QMAKE_EXECUTABLE "$ENV{Qt5_android}/bin/qmake") endif() configure_file(config-upnp-qt.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-upnp-qt.h ) add_subdirectory(src) add_subdirectory(icons) if (BUILD_TESTING) add_subdirectory(autotests) endif() add_subdirectory(doc) install( PROGRAMS org.kde.elisa.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} ) install( FILES org.kde.elisa.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") ki18n_install(po) endif() feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bcdae2f4..102e870e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,326 +1,325 @@ include_directories(${elisa_BINARY_DIR}) if (Qt5Quick_FOUND AND Qt5Widgets_FOUND) set(elisa_SOURCES main.cpp mediaplaylist.cpp musicstatistics.cpp musicalbum.cpp musicaudiotrack.cpp musicartist.cpp progressindicator.cpp databaseinterface.cpp musiclistenersmanager.cpp managemediaplayercontrol.cpp manageheaderbar.cpp manageaudioplayer.cpp trackslistener.cpp elisaapplication.cpp audiowrapper.cpp notificationitem.cpp topnotificationmanager.cpp elisautils.cpp trackdatahelper.cpp abstractfile/abstractfilelistener.cpp abstractfile/abstractfilelisting.cpp file/filelistener.cpp file/localfilelisting.cpp models/albummodel.cpp models/allalbumsmodel.cpp models/allartistsmodel.cpp models/alltracksmodel.cpp models/abstractmediaproxymodel.cpp models/allalbumsproxymodel.cpp models/allartistsproxymodel.cpp models/alltracksproxymodel.cpp models/singleartistproxymodel.cpp models/singlealbumproxymodel.cpp windows/WindowsTheme.qml windows/PlatformIntegration.qml android/ElisaMainWindow.qml android/AndroidTheme.qml android/PlatformIntegration.qml qml/ElisaMainWindow.qml qml/ApplicationMenu.qml qml/Theme.qml qml/PlatformIntegration.qml qml/LabelWithToolTip.qml qml/RatingStar.qml qml/PlayListEntry.qml qml/MediaBrowser.qml qml/DraggableItem.qml qml/PassiveNotification.qml qml/TopNotification.qml qml/TopNotificationItem.qml qml/TrackImportNotification.qml qml/HeaderBar.qml qml/NavigationActionBar.qml qml/MediaPlayerControl.qml qml/ContextView.qml qml/ViewSelector.qml qml/MediaPlayListView.qml qml/MediaAlbumView.qml qml/MediaAllTracksView.qml qml/MediaTrackDelegate.qml qml/MediaAlbumTrackDelegate.qml qml/MediaTrackMetadataView.qml qml/GridBrowserView.qml qml/GridBrowserDelegate.qml ) if (KF5Baloo_FOUND) if (Qt5DBus_FOUND) set(elisa_SOURCES ${elisa_SOURCES} baloo/localbaloofilelisting.cpp baloo/baloolistener.cpp ) qt5_add_dbus_interface(elisa_SOURCES ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.fileindexer.xml baloo/fileindexer) qt5_add_dbus_interface(elisa_SOURCES ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.scheduler.xml baloo/scheduler) endif() endif() if (Qt5DBus_FOUND) set(elisa_SOURCES ${elisa_SOURCES} mpris2/mpris2.cpp mpris2/mediaplayer2.cpp mpris2/mediaplayer2player.cpp ) endif() if (UPNPQT_FOUND) set(elisa_SOURCES ${elisa_SOURCES} upnp/upnpcontrolcontentdirectory.cpp upnp/upnpcontentdirectorymodel.cpp upnp/upnpcontrolconnectionmanager.cpp upnp/upnpcontrolmediaserver.cpp upnp/didlparser.cpp upnp/upnplistener.cpp upnp/upnpdiscoverallmusic.cpp ) endif() kconfig_add_kcfg_files(elisa_SOURCES elisa_settings.kcfgc) set(elisa_SOURCES ${elisa_SOURCES} elisa_core.kcfg ) qt5_add_resources(elisa_SOURCES resources.qrc) set_property(SOURCE qrc_resources.cpp PROPERTY SKIP_AUTOMOC ON) set(elisa_ICONS_PNG ../icons/128-apps-elisa.png ../icons/64-apps-elisa.png ../icons/48-apps-elisa.png ../icons/32-apps-elisa.png ../icons/22-apps-elisa.png ../icons/16-apps-elisa.png ) # add icons to application sources, to have them bundled ecm_add_app_icon(elisa_SOURCES ICONS ${elisa_ICONS_PNG}) add_executable(elisa ${elisa_SOURCES}) set_target_properties(elisa PROPERTIES LINK_FLAGS "-Wl,--no-undefined") target_include_directories(elisa PRIVATE ${KDSoap_INCLUDE_DIRS}) target_link_libraries(elisa LINK_PRIVATE Qt5::Core Qt5::Quick Qt5::Gui Qt5::Widgets Qt5::Multimedia Qt5::Svg Qt5::Sql Qt5::Concurrent - Qt5::QuickControls2 KF5::I18n KF5::ConfigCore KF5::ConfigGui KF5::FileMetaData KF5::CoreAddons ) if (Qt5DBus_FOUND) target_link_libraries(elisa LINK_PRIVATE Qt5::DBus ) endif() if (KF5KCMUtils_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::KCMUtils ) endif() if (Qt5AndroidExtras_FOUND) target_link_libraries(elisa LINK_PRIVATE Qt5::AndroidExtras ) endif() if (KF5Baloo_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Baloo ) endif() if (KF5Declarative_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Declarative ) endif() if (KF5XmlGui_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::XmlGui ) endif() if (KF5Crash_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::Crash ) endif() if (UPNPQT_FOUND) target_link_libraries(elisa LINK_PRIVATE UPNP::upnpQt Qt5::Network ) endif() if (KF5DBusAddons_FOUND) target_link_libraries(elisa LINK_PRIVATE KF5::DBusAddons ) endif() endif() install(TARGETS elisa ${INSTALL_TARGETS_DEFAULT_ARGS}) if (KF5ConfigWidgets_FOUND) add_subdirectory(localFileConfiguration) endif() set(elisaImport_SOURCES elisaimport.cpp elisaimportapplication.cpp elisaapplication.cpp mediaplaylist.cpp musicstatistics.cpp musicalbum.cpp musicaudiotrack.cpp musicartist.cpp manageaudioplayer.cpp progressindicator.cpp models/albummodel.cpp models/allalbumsmodel.cpp models/allartistsmodel.cpp models/alltracksmodel.cpp models/abstractmediaproxymodel.cpp models/allalbumsproxymodel.cpp models/allartistsproxymodel.cpp models/alltracksproxymodel.cpp models/singleartistproxymodel.cpp models/singlealbumproxymodel.cpp databaseinterface.cpp musiclistenersmanager.cpp trackslistener.cpp notificationitem.cpp topnotificationmanager.cpp elisautils.cpp abstractfile/abstractfilelistener.cpp abstractfile/abstractfilelisting.cpp file/filelistener.cpp file/localfilelisting.cpp ) if (KF5Baloo_FOUND) if (Qt5DBus_FOUND) set(elisaImport_SOURCES ${elisaImport_SOURCES} baloo/localbaloofilelisting.cpp baloo/baloolistener.cpp ) qt5_add_dbus_interface(elisaImport_SOURCES ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.fileindexer.xml baloo/fileindexer) qt5_add_dbus_interface(elisaImport_SOURCES ${BALOO_DBUS_INTERFACES_DIR}/org.kde.baloo.scheduler.xml baloo/scheduler) endif() endif() kconfig_add_kcfg_files(elisaImport_SOURCES elisa_settings.kcfgc) set(elisaImport_SOURCES ${elisaImport_SOURCES} elisa_core.kcfg ) add_executable(elisaImport ${elisaImport_SOURCES}) set_target_properties(elisaImport PROPERTIES LINK_FLAGS "-Wl,--no-undefined") target_link_libraries(elisaImport LINK_PRIVATE Qt5::Core Qt5::Sql Qt5::Multimedia Qt5::Widgets Qt5::Concurrent KF5::I18n KF5::ConfigCore KF5::ConfigGui KF5::FileMetaData ) if (KF5XmlGui_FOUND) target_link_libraries(elisaImport LINK_PRIVATE KF5::XmlGui ) endif() if (KF5KCMUtils_FOUND) target_link_libraries(elisaImport LINK_PRIVATE KF5::KCMUtils ) endif() if (KF5Baloo_FOUND) target_link_libraries(elisaImport LINK_PRIVATE KF5::Baloo ) endif() diff --git a/src/main.cpp b/src/main.cpp index 5a1ec0a8..3d6b0c31 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,267 +1,263 @@ /* * Copyright 2015-2017 Matthieu Gallien * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ #include "config-upnp-qt.h" //#define QT_QML_DEBUG #if defined UPNPQT_FOUND && UPNPQT_FOUND #include "upnp/upnpcontrolconnectionmanager.h" #include "upnp/upnpcontrolmediaserver.h" #include "upnp/upnpcontrolcontentdirectory.h" #include "upnp/upnpcontentdirectorymodel.h" #include "upnpdevicedescription.h" #include "upnp/didlparser.h" #include "upnp/upnpdiscoverallmusic.h" #include "upnpssdpengine.h" #include "upnpabstractservice.h" #include "upnpcontrolabstractdevice.h" #include "upnpcontrolabstractservice.h" #include "upnpbasictypes.h" #endif #include "progressindicator.h" #include "mediaplaylist.h" #include "managemediaplayercontrol.h" #include "manageheaderbar.h" #include "manageaudioplayer.h" #include "musicstatistics.h" #include "musicaudiotrack.h" #include "musiclistenersmanager.h" #include "models/allalbumsmodel.h" #include "models/albummodel.h" #include "models/allartistsmodel.h" #include "models/alltracksmodel.h" #include "models/allalbumsproxymodel.h" #include "models/alltracksproxymodel.h" #include "models/allartistsproxymodel.h" #include "models/singleartistproxymodel.h" #include "models/singlealbumproxymodel.h" #include "elisaapplication.h" #include "audiowrapper.h" #include "notificationitem.h" #include "topnotificationmanager.h" #include "elisa_settings.h" #include "trackdatahelper.h" #include "elisautils.h" #if defined Qt5DBus_FOUND && Qt5DBus_FOUND #include "mpris2/mpris2.h" #include "mpris2/mediaplayer2player.h" #endif #if defined KF5Declarative_FOUND && KF5Declarative_FOUND #include #endif #include #include #include #if defined KF5Crash_FOUND && KF5Crash_FOUND #include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include -#include #if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND #include #include #endif #if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND #include #endif #if defined Q_OS_ANDROID int __attribute__((visibility("default"))) main(int argc, char *argv[]) #else int main(int argc, char *argv[]) #endif { QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); qputenv("QT_GSTREAMER_USE_PLAYBIN_VOLUME", "true"); QApplication app(argc, argv); #if defined KF5Crash_FOUND && KF5Crash_FOUND KCrash::initialize(); #endif - QQuickStyle::setStyle(QStringLiteral("org.kde.desktop")); - QQuickStyle::setFallbackStyle(QStringLiteral("Universal")); - QApplication::setWindowIcon(QIcon::fromTheme(QStringLiteral("new-audio-alarm"))); KLocalizedString::setApplicationDomain("elisa"); #if defined UPNPQT_FOUND && UPNPQT_FOUND qmlRegisterType("org.kde.elisa", 1, 0, "UpnpSsdpEngine"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpDiscoverAllMusic"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpAbstractDevice"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpAbstractService"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpControlAbstractDevice"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpControlAbstractService"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpControlConnectionManager"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpControlMediaServer"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpContentDirectoryModel"); qmlRegisterType("org.kde.elisa", 1, 0, "DidlParser"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpControlContentDirectory"); qmlRegisterType("org.kde.elisa", 1, 0, "UpnpDeviceDescription"); qRegisterMetaType(); qRegisterMetaType >(); qRegisterMetaType(); qRegisterMetaType(); qRegisterMetaType(); #endif qmlRegisterType("org.kde.elisa", 1, 0, "MediaPlayList"); qmlRegisterType("org.kde.elisa", 1, 0, "ManageMediaPlayerControl"); qmlRegisterType("org.kde.elisa", 1, 0, "ManageHeaderBar"); qmlRegisterType("org.kde.elisa", 1, 0, "ManageAudioPlayer"); qmlRegisterType("org.kde.elisa", 1, 0, "MusicStatistics"); qmlRegisterType("org.kde.elisa", 1, 0, "ProgressIndicator"); qmlRegisterType("org.kde.elisa", 1, 0, "MusicListenersManager"); qmlRegisterType("org.kde.elisa", 1, 0, "AlbumModel"); qmlRegisterType("org.kde.elisa", 1, 0, "AllAlbumsProxyModel"); qmlRegisterType("org.kde.elisa", 1, 0, "AllArtistsProxyModel"); qmlRegisterType("org.kde.elisa", 1, 0, "AllTracksProxyModel"); qmlRegisterType("org.kde.elisa", 1, 0, "SingleAlbumProxyModel"); qmlRegisterType("org.kde.elisa", 1, 0, "SingleArtistProxyModel"); qmlRegisterType("org.kde.elisa", 1, 0, "AudioWrapper"); qmlRegisterType("org.kde.elisa", 1, 0, "TopNotificationManager"); qmlRegisterType("org.kde.elisa", 1, 0, "TrackDataHelper"); #if defined Qt5DBus_FOUND && Qt5DBus_FOUND qmlRegisterType("org.kde.elisa", 1, 0, "Mpris2"); qRegisterMetaType(); #endif qRegisterMetaType(); qRegisterMetaType>("QHash"); qRegisterMetaType>("QList"); qRegisterMetaType>("QVector"); qRegisterMetaType>("QList"); qRegisterMetaType>("QVector"); qRegisterMetaType>("QHash"); qRegisterMetaType("MusicAlbum"); qRegisterMetaType("MusicArtist"); qRegisterMetaType>(); qRegisterMetaType(); qRegisterMetaType("NotificationItem"); qRegisterMetaType>("QMap"); qRegisterMetaType("ElisaUtils::PlayListEnqueueMode"); qRegisterMetaType("ElisaUtils::PlayListEnqueueTriggerPlay"); qmlRegisterUncreatableType("org.kde.elisa", 1, 0, "ElisaApplication", QStringLiteral("only one and done in c++")); qRegisterMetaTypeStreamOperators("PlayListControler::PlayerState"); KAboutData aboutData( QStringLiteral("elisa"), i18n("Elisa"), QStringLiteral("0.0.81"), i18n("A Simple Music Player written with KDE Frameworks"), KAboutLicense::LGPL_V3, i18n("(c) 2015-2017, Matthieu Gallien <mgallien@mgallien.fr>")); aboutData.addAuthor(QStringLiteral("Matthieu Gallien"),i18n("Creator"), QStringLiteral("mgallien@mgallien.fr")); aboutData.addAuthor(QStringLiteral("Alexander Stippich"), i18n("Author"), QStringLiteral("a.stippich@gmx.net")); aboutData.addCredit(QStringLiteral("Andrew Lake"), i18n("Concept and design work"), QStringLiteral("jamboarder@gmail.com")); aboutData.addCredit(QStringLiteral("Luigi Toscano"), i18n("Localization support"), QStringLiteral("luigi.toscano@tiscali.it")); aboutData.addCredit(QStringLiteral("Safa Alfulaij"), i18n("Right to left support in interface"), QStringLiteral("safa1996alfulaij@gmail.com")); aboutData.addCredit(QStringLiteral("Diego Gangl"), i18n("Various improvements to the interface"), QStringLiteral("diego@sinestesia.co")); KAboutData::setApplicationData(aboutData); #if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND KDBusService elisaService(KDBusService::Unique); #endif KLocalizedString::setApplicationDomain("elisa"); ElisaApplication myApp; #if defined KF5DBusAddons_FOUND && KF5DBusAddons_FOUND QObject::connect(&elisaService, &KDBusService::activateActionRequested, &myApp, &ElisaApplication::activateActionRequested); QObject::connect(&elisaService, &KDBusService::activateRequested, &myApp, &ElisaApplication::activateRequested); QObject::connect(&elisaService, &KDBusService::openRequested, &myApp, &ElisaApplication::openRequested); #endif QCommandLineParser parser; parser.addHelpOption(); parser.addVersionOption(); aboutData.setupCommandLine(&parser); parser.process(app); aboutData.processCommandLine(&parser); myApp.setArguments(parser.positionalArguments()); #if defined Qt5AndroidExtras_FOUND && Qt5AndroidExtras_FOUND qDebug() << QCoreApplication::arguments(); QAndroidJniObject::callStaticMethod("com/kde/elisa/ElisaService", "startMyService", "(Landroid/content/Context;)V", QtAndroid::androidContext().object()); #endif auto configurationFileName = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation); configurationFileName += QStringLiteral("/elisarc"); Elisa::ElisaConfiguration::instance(configurationFileName); Elisa::ElisaConfiguration::self()->load(); Elisa::ElisaConfiguration::self()->save(); QQmlApplicationEngine engine; engine.addImportPath(QStringLiteral("qrc:/imports")); QQmlFileSelector selector(&engine); #if defined KF5Declarative_FOUND && KF5Declarative_FOUND KDeclarative::KDeclarative decl; decl.setDeclarativeEngine(&engine); decl.setupBindings(); #endif engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); engine.rootContext()->setContextProperty(QStringLiteral("elisa"), &myApp); engine.rootContext()->setContextProperty(QStringLiteral("logicalDpi"), QGuiApplication::primaryScreen()->logicalDotsPerInch()); engine.load(QUrl(QStringLiteral("qrc:/qml/ElisaMainWindow.qml"))); return app.exec(); }