From e1f75ed04aa2a6c1284ce962421796347fef7a90 Mon Sep 17 00:00:00 2001 From: Slava Monich Date: Sun, 31 Mar 2019 02:38:26 +0200 Subject: [PATCH] [app] Only use those HarbourLib classes that we really need --- app/app.pro | 28 +++++++++++++++++++++++----- app/qml/BooksMain.qml | 22 +++++++++++----------- app/qml/BooksStorageView.qml | 25 +++++++++++++------------ app/src/main.cpp | 27 +++++++++++++-------------- harbour-books.pro | 2 +- 5 files changed, 61 insertions(+), 43 deletions(-) diff --git a/app/app.pro b/app/app.pro index 9909793..c4914b9 100644 --- a/app/app.pro +++ b/app/app.pro @@ -30,22 +30,22 @@ FRIBIDI_DIR = $$_PRO_FILE_PWD_/../fribidi LINEBREAK_DIR = $$_PRO_FILE_PWD_/../linebreak HARBOUR_LIB_DIR = $$_PRO_FILE_PWD_/../harbour-lib +HARBOUR_INCLUDE_DIR = $$HARBOUR_LIB_DIR/include +HARBOUR_SRC_DIR = $$HARBOUR_LIB_DIR/src + # Libraries FBREADER_LIB = $$OUT_PWD/../fbreader/libfbreader.a FRIBIDI_LIB = $$OUT_PWD/../fribidi/libfribidi.a LINEBREAK_LIB = $$OUT_PWD/../linebreak/liblinebreak.a -HARBOUR_LIB = $$OUT_PWD/../harbour-lib/libharbour-lib.a PRE_TARGETDEPS += \ $$FBREADER_LIB \ $$FRIBIDI_LIB \ - $$LINEBREAK_LIB \ - $$HARBOUR_LIB + $$LINEBREAK_LIB LIBS += \ $$FBREADER_LIB \ $$FRIBIDI_LIB \ $$LINEBREAK_LIB \ - $$HARBOUR_LIB \ -lbz2 -lz -ldl OTHER_FILES += \ @@ -86,7 +86,7 @@ INSTALLS += formats INCLUDEPATH += \ src \ - $$HARBOUR_LIB_DIR/include \ + $$HARBOUR_INCLUDE_DIR \ $$FBREADER_DIR/fbreader/fbreader/src \ $$FBREADER_DIR/fbreader/zlibrary/text/include \ $$FBREADER_DIR/fbreader/zlibrary/core/include \ @@ -173,6 +173,24 @@ HEADERS += \ src/BooksTypes.h \ src/BooksUtil.h +# harbour-lib + +HEADERS += \ + $$HARBOUR_INCLUDE_DIR/HarbourDisplayBlanking.h \ + $$HARBOUR_INCLUDE_DIR/HarbourJson.h \ + $$HARBOUR_INCLUDE_DIR/HarbourPluginLoader.h \ + $$HARBOUR_INCLUDE_DIR/HarbourTask.h + +HEADERS += \ + $$HARBOUR_SRC_DIR/HarbourMce.h + +SOURCES += \ + $$HARBOUR_SRC_DIR/HarbourDisplayBlanking.cpp \ + $$HARBOUR_SRC_DIR/HarbourJson.cpp \ + $$HARBOUR_SRC_DIR/HarbourMce.cpp \ + $$HARBOUR_SRC_DIR/HarbourPluginLoader.cpp \ + $$HARBOUR_SRC_DIR/HarbourTask.cpp + # Icons ICON_SIZES = 86 108 128 256 for(s, ICON_SIZES) { diff --git a/app/qml/BooksMain.qml b/app/qml/BooksMain.qml index 56bdd71..b35124f 100644 --- a/app/qml/BooksMain.qml +++ b/app/qml/BooksMain.qml @@ -1,6 +1,6 @@ /* - Copyright (C) 2015-2018 Jolla Ltd. - Copyright (C) 2015-2018 Slava Monich + Copyright (C) 2015-2019 Jolla Ltd. + Copyright (C) 2015-2019 Slava Monich You may use this file under the terms of BSD license as follows: @@ -8,14 +8,15 @@ modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Jolla Ltd nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + 3. Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -53,7 +54,6 @@ ApplicationWindow { BooksHints { id: globalHints } BooksFeedback { id: globalFeedback } - SystemState { id: globalSystemState } DisplayBlanking { pauseRequested: Qt.application.active && Settings.currentBook && diff --git a/app/qml/BooksStorageView.qml b/app/qml/BooksStorageView.qml index f29177d..1ebf842 100644 --- a/app/qml/BooksStorageView.qml +++ b/app/qml/BooksStorageView.qml @@ -1,6 +1,6 @@ /* - Copyright (C) 2015-2018 Jolla Ltd. - Contact: Slava Monich + Copyright (C) 2015-2019 Jolla Ltd. + Copyright (C) 2015-2019 Slava Monich You may use this file under the terms of BSD license as follows: @@ -8,14 +8,15 @@ modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of Jolla Ltd nor the names of its contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer + in the documentation and/or other materials provided with the + distribution. + 3. Neither the names of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE @@ -146,8 +147,8 @@ SilicaFlickable { } Connections { - target: globalSystemState - onLockModeChanged: if (target.lockMode === globalSystemState.MCE_TK_LOCKED) editMode = false + target: Qt.application + onActiveChanged: if (!Qt.application.active) editMode = false } BookStorage { diff --git a/app/src/main.cpp b/app/src/main.cpp index acbf63b..451fdce 100644 --- a/app/src/main.cpp +++ b/app/src/main.cpp @@ -1,6 +1,6 @@ /* - * Copyright (C) 2015-2018 Jolla Ltd. - * Copyright (C) 2015-2018 Slava Monich + * Copyright (C) 2015-2019 Jolla Ltd. + * Copyright (C) 2015-2019 Slava Monich * * You may use this file under the terms of the BSD license as follows: * @@ -8,15 +8,15 @@ * modification, are permitted provided that the following conditions * are met: * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * * Neither the name of Jolla Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this - * software without specific prior written permission. + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * 3. Neither the names of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -49,8 +49,8 @@ #include "BooksFeedback.h" #include "BooksHints.h" +#include "HarbourDisplayBlanking.h" #include "HarbourDebug.h" -#include "HarbourLib.h" #include "ZLibrary.h" @@ -86,8 +86,7 @@ Q_DECL_EXPORT int main(int argc, char **argv) BOOKS_QML_REGISTER(BooksFeedback, "BooksFeedback"); BOOKS_QML_REGISTER(BooksHints, "BooksHints"); BOOKS_QML_REGISTER(BooksSettings, "BooksSettings"); - HarbourLib::registerTypes(BOOKS_QML_PLUGIN, - BOOKS_QML_PLUGIN_V1, BOOKS_QML_PLUGIN_V2); + BOOKS_QML_REGISTER(HarbourDisplayBlanking, "DisplayBlanking"); QLocale locale; QTranslator* translator = new QTranslator(app); diff --git a/harbour-books.pro b/harbour-books.pro index 6a9a26b..f2e5b7a 100644 --- a/harbour-books.pro +++ b/harbour-books.pro @@ -1,6 +1,6 @@ TEMPLATE = subdirs CONFIG += ordered -SUBDIRS = fribidi linebreak fbreader harbour-lib app +SUBDIRS = fribidi linebreak fbreader app OTHER_FILES += \ README.md \