diff --git a/mobile/app/CMakeLists.txt b/mobile/app/CMakeLists.txt --- a/mobile/app/CMakeLists.txt +++ b/mobile/app/CMakeLists.txt @@ -1,14 +1,7 @@ +set(CMAKE_AUTORCC ON) +add_executable(okularkirigami main.cpp app.qrc) +target_link_libraries(okularkirigami Qt5::Widgets Qt5::Qml KF5::I18n) +install(TARGETS okularkirigami ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -include_directories( ${QT_INCLUDES} ) - -#add_subdirectory(src) - -# QML-only thing -#install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATADIR}/plasma/packages/org.kde.active.documentviewer) - -install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATADIR}/kpackage/genericqml/org.kde.mobile.okular) install(FILES package/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.mobile.okular.desktop) - -#install(FILES active-documentviewer.desktop DESTINATION ${KDE_INSTALL_APPDIR}) - diff --git a/mobile/app/app.qrc b/mobile/app/app.qrc new file mode 100644 --- /dev/null +++ b/mobile/app/app.qrc @@ -0,0 +1,13 @@ + + +package/contents/ui/Bookmarks.qml +package/contents/ui/Documents.qml +package/contents/ui/main.qml +package/contents/ui/MainView.qml +package/contents/ui/OkularDrawer.qml +package/contents/ui/TableOfContents.qml +package/contents/ui/Thumbnails.qml +package/contents/ui/ThumbnailsBase.qml +package/contents/ui/TreeDelegate.qml + + diff --git a/mobile/app/main.cpp b/mobile/app/main.cpp new file mode 100644 --- /dev/null +++ b/mobile/app/main.cpp @@ -0,0 +1,46 @@ +/************************************************************************************* + * Copyright (C) 2010 by Aleix Pol * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program 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 General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software * + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * + *************************************************************************************/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +Q_DECL_EXPORT int main(int argc, char *argv[]) +{ +#ifdef __ANDROID__ + qputenv("QT_QUICK_CONTROLS_STYLE", "material"); +#endif + QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling); + QApplication app(argc, argv); + app.setApplicationName(QStringLiteral("okularmobile")); + + QQmlApplicationEngine engine; + engine.rootContext()->setContextObject(new KLocalizedContext(&engine)); + + engine.setBaseUrl(QUrl("qrc:/package/contents/ui/")); + engine.load(QUrl("qrc:/package/contents/ui/main.qml")); + return app.exec(); +} diff --git a/mobile/app/package/metadata.desktop b/mobile/app/package/metadata.desktop --- a/mobile/app/package/metadata.desktop +++ b/mobile/app/package/metadata.desktop @@ -109,7 +109,7 @@ GenericName[zh_CN]=文档查看器 GenericName[zh_TW]=文件檢視器 Type=Application -Exec=kpackagelauncherqml -a org.kde.mobile.okular %u +Exec=okularkirigami Icon=okular NoDisplay=true X-KDE-ParentApp=