From 3d6bb94a9e7c80edc4b2a2321b464533a4a7f60b Mon Sep 17 00:00:00 2001 From: aavit Date: Wed, 10 Sep 2014 14:50:28 +0200 Subject: Rename DroidUtils -> B2QtUtils and refactor the API Preparing this module for being documented and presented for external users. - Renamed since this is for eLinux as well as eAndroid - Provide all settings as proper Q_PROPERTYs for easy QML access - Hide all the detailed audio stuff that's not useful for users - Implement a getter function for current backlight, so that we don't have to reset it to full every time this module is loaded - qmake now groks this as internal module, so get rid build kludges - hostname setting on eLinux fixed - getIPAddress() now returns ALL active addresses, and implentation is simplified Task-number: QTEE-704 Change-Id: I9f22d5531b5963ae7e78c840bcfe1edd6197f82a Reviewed-by: Samuli Piippo --- src/imports/utils/plugin.cpp | 12 ++++++------ src/imports/utils/qmldir | 4 ++-- src/imports/utils/utils.pro | 10 +++------- 3 files changed, 11 insertions(+), 15 deletions(-) (limited to 'src/imports/utils') diff --git a/src/imports/utils/plugin.cpp b/src/imports/utils/plugin.cpp index 5431061..46aa4d2 100644 --- a/src/imports/utils/plugin.cpp +++ b/src/imports/utils/plugin.cpp @@ -16,32 +16,32 @@ ** the contact form at http://qt.digia.com/ ** ****************************************************************************/ -#include +#include #include static QObject *module_api_factory(QQmlEngine *engine, QJSEngine *scriptEngine) { Q_UNUSED(engine) Q_UNUSED(scriptEngine) - QDroidUtils *api = new QDroidUtils(); + B2QtDevice *api = new B2QtDevice(); return api; } -class QDroidUtilsPlugin : public QQmlExtensionPlugin +class B2QtUtilsPlugin : public QQmlExtensionPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - QDroidUtilsPlugin() + B2QtUtilsPlugin() { } void registerTypes(const char *uri) { - Q_ASSERT(QLatin1String(uri) == "QtDroid.Utils"); - qmlRegisterSingletonType(uri, 1, 0, "DroidUtils", module_api_factory); + Q_ASSERT(QLatin1String(uri) == "B2Qt.Utils"); + qmlRegisterSingletonType(uri, 1, 0, "B2QtDevice", module_api_factory); } }; diff --git a/src/imports/utils/qmldir b/src/imports/utils/qmldir index 6db1b0f..e5e0b31 100644 --- a/src/imports/utils/qmldir +++ b/src/imports/utils/qmldir @@ -1,3 +1,3 @@ -module QtDroid.Utils -plugin qtdroidutilsplugin +module B2Qt.Utils +plugin b2qtutilsplugin typeinfo plugins.qmltypes diff --git a/src/imports/utils/utils.pro b/src/imports/utils/utils.pro index a589b46..a580643 100644 --- a/src/imports/utils/utils.pro +++ b/src/imports/utils/utils.pro @@ -1,14 +1,10 @@ CXX_MODULE = qml -TARGET = qtdroidutilsplugin -TARGETPATH = QtDroid/Utils +TARGET = b2qtutilsplugin +TARGETPATH = B2Qt/Utils IMPORT_VERSION = 1.0 -QT += qml +QT += qml b2qtutils SOURCES += plugin.cpp -### kludge -INCLUDEPATH += $$PWD/../../../include -LIBS += -L$$PWD/../../../lib -lQt5DroidUtils - load(qml_plugin) -- cgit v1.2.3