[harbour-lib] Pulled in HarbourLib updates

Replaced BooksMediaPlugin and BooksPolicyPlugin with
HarbourMediaPlugin and HarbourPolicyPlugin, respectively.
This commit is contained in:
Slava Monich 2020-10-22 04:01:33 +03:00
parent 8a247fb7e2
commit cfa9a1ad79
7 changed files with 10 additions and 259 deletions

View file

@ -115,12 +115,10 @@ SOURCES += \
src/BooksImportModel.cpp \
src/BooksListWatcher.cpp \
src/BooksLoadingProperty.cpp \
src/BooksMediaPlugin.cpp \
src/BooksPageStack.cpp \
src/BooksPageWidget.cpp \
src/BooksPaintContext.cpp \
src/BooksPathModel.cpp \
src/BooksPolicyPlugin.cpp \
src/BooksPos.cpp \
src/BooksSaveTimer.cpp \
src/BooksSettings.cpp \
@ -159,12 +157,10 @@ HEADERS += \
src/BooksItem.h \
src/BooksListWatcher.h \
src/BooksLoadingProperty.h \
src/BooksMediaPlugin.h \
src/BooksPageStack.h \
src/BooksPageWidget.h \
src/BooksPaintContext.h \
src/BooksPathModel.h \
src/BooksPolicyPlugin.h \
src/BooksPos.h \
src/BooksSaveTimer.h \
src/BooksSettings.h \
@ -183,7 +179,9 @@ HEADERS += \
$$HARBOUR_INCLUDE_DIR/HarbourDisplayBlanking.h \
$$HARBOUR_INCLUDE_DIR/HarbourImageProvider.h \
$$HARBOUR_INCLUDE_DIR/HarbourJson.h \
$$HARBOUR_INCLUDE_DIR/HarbourMediaPlugin.h \
$$HARBOUR_INCLUDE_DIR/HarbourPluginLoader.h \
$$HARBOUR_INCLUDE_DIR/HarbourPolicyPlugin.h \
$$HARBOUR_INCLUDE_DIR/HarbourSystem.h \
$$HARBOUR_INCLUDE_DIR/HarbourTask.h \
$$HARBOUR_INCLUDE_DIR/HarbourTheme.h
@ -196,7 +194,9 @@ SOURCES += \
$$HARBOUR_SRC_DIR/HarbourImageProvider.cpp \
$$HARBOUR_SRC_DIR/HarbourJson.cpp \
$$HARBOUR_SRC_DIR/HarbourMce.cpp \
$$HARBOUR_SRC_DIR/HarbourMediaPlugin.cpp \
$$HARBOUR_SRC_DIR/HarbourPluginLoader.cpp \
$$HARBOUR_SRC_DIR/HarbourPolicyPlugin.cpp \
$$HARBOUR_SRC_DIR/HarbourSystem.cpp \
$$HARBOUR_SRC_DIR/HarbourTask.cpp \
$$HARBOUR_SRC_DIR/HarbourTheme.cpp

View file

@ -1,69 +0,0 @@
/*
* Copyright (C) 2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BooksMediaPlugin.h"
// Workaround for org.nemomobile.policy (or Sailfish.Media) not being
// allowed in harbour apps
BooksMediaPlugin* BooksMediaPlugin::gInstance = Q_NULLPTR;
const char BooksMediaPlugin::MEDIAKEY_QML_TYPE[] = "MediaKey";
BooksMediaPlugin::BooksMediaPlugin(
QQmlEngine* aEngine) :
HarbourPluginLoader(aEngine, "Sailfish.Media", 1, 0)
{
}
void
BooksMediaPlugin::registerTypes(
const char* aModule,
int aMajor,
int aMinor)
{
reRegisterType(MEDIAKEY_QML_TYPE, aModule, aMajor, aMinor);
}
void
BooksMediaPlugin::registerTypes(
QQmlEngine* aEngine,
const char* aModule,
int aMajor,
int aMinor)
{
if (!gInstance) {
gInstance = new BooksMediaPlugin(aEngine);
}
gInstance->registerTypes(aModule, aMajor, aMinor);
}

View file

@ -1,53 +0,0 @@
/*
* Copyright (C) 2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BOOKS_MEDIA_PLUGIN_H
#define BOOKS_MEDIA_PLUGIN_H
#include "HarbourPluginLoader.h"
class BooksMediaPlugin : public HarbourPluginLoader
{
static BooksMediaPlugin* gInstance;
static const char MEDIAKEY_QML_TYPE[];
public:
static void registerTypes(QQmlEngine* aEngine, const char* aModule,
int aMajor, int aMinor);
private:
BooksMediaPlugin(QQmlEngine* aEngine);
void registerTypes(const char* aModule, int aMajor, int aMinor);
};
#endif // BOOKS_MEDIA_KEY_H

View file

@ -1,71 +0,0 @@
/*
* Copyright (C) 2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "BooksPolicyPlugin.h"
// Workaround for org.nemomobile.policy (or Nemo.Policy) not being
// allowed in harbour apps
BooksPolicyPlugin* BooksPolicyPlugin::gInstance = Q_NULLPTR;
const char BooksPolicyPlugin::RESOURCE_QML_TYPE[] = "Resource";
const char BooksPolicyPlugin::PERMISSIONS_QML_TYPE[] = "Permissions";
BooksPolicyPlugin::BooksPolicyPlugin(
QQmlEngine* aEngine) :
HarbourPluginLoader(aEngine, "org.nemomobile.policy", 1, 0)
{
}
void
BooksPolicyPlugin::registerTypes(
const char* aModule,
int aMajor,
int aMinor)
{
reRegisterType(RESOURCE_QML_TYPE, aModule, aMajor, aMinor);
reRegisterType(PERMISSIONS_QML_TYPE, aModule, aMajor, aMinor);
}
void
BooksPolicyPlugin::registerTypes(
QQmlEngine* aEngine,
const char* aModule,
int aMajor,
int aMinor)
{
if (!gInstance) {
gInstance = new BooksPolicyPlugin(aEngine);
}
gInstance->registerTypes(aModule, aMajor, aMinor);
}

View file

@ -1,56 +0,0 @@
/*
* Copyright (C) 2017 Jolla Ltd.
* Contact: Slava Monich <slava.monich@jolla.com>
*
* You may use this file under the terms of the BSD license as follows:
*
* Redistribution and use in source and binary forms, with or without
* 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.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef BOOKS_POLICY_PLUGIN_H
#define BOOKS_POLICY_PLUGIN_H
#include "HarbourPluginLoader.h"
class QQmlEngine;
class BooksPolicyPlugin : public HarbourPluginLoader
{
static BooksPolicyPlugin* gInstance;
static const char RESOURCE_QML_TYPE[];
static const char PERMISSIONS_QML_TYPE[];
public:
static void registerTypes(QQmlEngine* aEngine, const char* aModule,
int aMajor, int aMinor);
private:
BooksPolicyPlugin(QQmlEngine* aEngine);
void registerTypes(const char* aModule, int aMajor, int aMinor);
};
#endif // BOOKS_POLICY_PLUGIN_H

View file

@ -22,7 +22,7 @@
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
@ -36,12 +36,12 @@
#include "BooksPaintContext.h"
#include "BooksDialogManager.h"
#include "BooksImageProvider.h"
#include "BooksMediaPlugin.h"
#include "BooksPolicyPlugin.h"
#include "BooksSettings.h"
#include "HarbourDebug.h"
#include "HarbourImageProvider.h"
#include "HarbourMediaPlugin.h"
#include "HarbourPolicyPlugin.h"
#include "ZLibrary.h"
#include "ZLApplication.h"
@ -244,9 +244,9 @@ void ZLibrary::run(ZLApplication* aApp)
QQmlContext* root = view->rootContext();
QQmlEngine* engine = root->engine();
QSharedPointer<BooksSettings> settings = BooksSettings::sharedInstance();
BooksPolicyPlugin::registerTypes(engine, BOOKS_QML_PLUGIN,
HarbourPolicyPlugin::registerTypes(engine, BOOKS_QML_PLUGIN,
BOOKS_QML_PLUGIN_V1, BOOKS_QML_PLUGIN_V2);
BooksMediaPlugin::registerTypes(engine, BOOKS_QML_PLUGIN,
HarbourMediaPlugin::registerTypes(engine, BOOKS_QML_PLUGIN,
BOOKS_QML_PLUGIN_V1, BOOKS_QML_PLUGIN_V2);
engine->addImageProvider("harbour", new HarbourImageProvider);
engine->addImageProvider(BooksImageProvider::PROVIDER_ID,

@ -1 +1 @@
Subproject commit 953cce863a85fc431cba0ebd936789e0f2fa25dc
Subproject commit 47b34ac6653aebd34ad4e80bbbe91f64bbbc763b