aboutsummaryrefslogtreecommitdiffstats
path: root/src/remotesettings
diff options
context:
space:
mode:
authorDominik Holland <dominik.holland@pelagicore.com>2019-05-21 13:57:26 +0200
committerDominik Holland <dominik.holland@pelagicore.com>2019-05-27 19:18:22 +0000
commit4ac5ee7a7570215fedab390ef3965bc6e22ba82d (patch)
tree81451bbdc9d467cd5fa04f25b32b464b4a12d7b1 /src/remotesettings
parent29a4736de95fb9125c71baa56da37931f68764d6 (diff)
[build-system] Also autogenerate the C++ QML plugins
Using the new 'qmlplugin' ivigenerator template, we can now also generate the QML plugin and its qmldir and qmltypes file. Change-Id: Iedd7e220861b48f2a6d6e1c9e0da68c47b7dfc44 Reviewed-by: Bramastyo Harimukti Santoso <bramastyo.harimukti.santoso@pelagicore.com>
Diffstat (limited to 'src/remotesettings')
-rw-r--r--src/remotesettings/qml_plugin/plugin.cpp54
-rw-r--r--src/remotesettings/qml_plugin/qml_plugin.pro14
-rw-r--r--src/remotesettings/qml_plugin/qmldir3
-rw-r--r--src/remotesettings/remotesettings.qface1
4 files changed, 12 insertions, 60 deletions
diff --git a/src/remotesettings/qml_plugin/plugin.cpp b/src/remotesettings/qml_plugin/plugin.cpp
deleted file mode 100644
index 9bc8bb21..00000000
--- a/src/remotesettings/qml_plugin/plugin.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2019 Luxoft Sweden AB
-** Copyright (C) 2018 Pelagicore AG
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the Neptune 3 IVI UI.
-**
-** $QT_BEGIN_LICENSE:GPL-QTAS$
-** Commercial License Usage
-** Licensees holding valid commercial Qt Automotive Suite licenses may use
-** this file in accordance with the commercial license agreement provided
-** with the Software or, alternatively, in accordance with the terms
-** contained in a written agreement between you and The Qt Company. For
-** licensing terms and conditions see https://www.qt.io/terms-conditions.
-** For further information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 or (at your option) any later version
-** approved by the KDE Free Qt Foundation. The licenses are as published by
-** the Free Software Foundation and appearing in the file LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-** SPDX-License-Identifier: GPL-3.0
-**
-****************************************************************************/
-#include <QtQml/qqmlextensionplugin.h>
-#include <qqml.h>
-
-#include "remotesettingsmodule.h"
-
-QT_BEGIN_NAMESPACE
-
-class RemoteSettingsPlugin : public QQmlExtensionPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
-public:
- virtual void registerTypes(const char *uri) override
- {
- Q_ASSERT(QLatin1String(uri) == QLatin1String("shared.com.pelagicore.remotesettings"));
-
- RemoteSettingsModule::registerQmlTypes(uri, 1, 0);
- }
-};
-
-QT_END_NAMESPACE
-
-#include "plugin.moc"
diff --git a/src/remotesettings/qml_plugin/qml_plugin.pro b/src/remotesettings/qml_plugin/qml_plugin.pro
index 9ac0b76f..741a55ca 100644
--- a/src/remotesettings/qml_plugin/qml_plugin.pro
+++ b/src/remotesettings/qml_plugin/qml_plugin.pro
@@ -1,16 +1,24 @@
TEMPLATE = lib
CONFIG += plugin
-TARGET = remotesettingsplugin
QT += qml
LIBS += -L$$LIB_DESTDIR -l$$qtLibraryTarget(remotesettings)
INCLUDEPATH += $$OUT_PWD/../frontend
+QT_FOR_CONFIG += ivicore
+!qtConfig(ivigenerator): error("No ivigenerator available: Make sure QtIvi is installed and configured correctly")
+
include($$SOURCE_DIR/config.pri)
-SOURCES += \
- plugin.cpp
+QFACE_FORMAT = qmlplugin
+QFACE_SOURCES = ../remotesettings.qface
+
+load(ivigenerator)
+# the qmlplugin template provides the URI variable to read the uri from the qface files, but this
+# already contains the shared prefix, and the qmlplugin prf adds one as well
uri = com.pelagicore.remotesettings
+EXTRA_FILES += $$OUT_PWD/qmldir \
+ $$OUT_PWD/plugins.qmltypes
load(qmlplugin)
QMAKE_RPATHDIR += $$QMAKE_REL_RPATH_BASE/$$relative_path($$INSTALL_PREFIX/neptune3/lib, $$installPath)
diff --git a/src/remotesettings/qml_plugin/qmldir b/src/remotesettings/qml_plugin/qmldir
deleted file mode 100644
index 61ab26a1..00000000
--- a/src/remotesettings/qml_plugin/qmldir
+++ /dev/null
@@ -1,3 +0,0 @@
-module shared.com.pelagicore.remotesettings
-plugin remotesettingsplugin
-classname RemoteSettingsPlugin
diff --git a/src/remotesettings/remotesettings.qface b/src/remotesettings/remotesettings.qface
index 33a0c26a..4e1d6bbc 100644
--- a/src/remotesettings/remotesettings.qface
+++ b/src/remotesettings/remotesettings.qface
@@ -1,3 +1,4 @@
+@config: { qml_type: "shared.com.pelagicore.remotesettings" }
module RemoteSettings 1.0
interface UISettings {