diff options
author | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-06-20 01:26:48 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@theqtcompany.com> | 2015-12-02 12:20:32 +0000 |
commit | ec5a886d4b92a18669d5bbd01b43a57f7d81b856 (patch) | |
tree | 688305c899ce01c73b8a3cf94d825f4fddc5642a /src/imports/localstorage | |
parent | c3a818d19e34e08e0759dedce18d9daa5ba7d94e (diff) |
Utilize the resources when building statically.
This is needed so that the qmldir file is picked up correctly when using a
static build of the plugins in the application as this gets taken care of
automatically by qmake. The Q_INIT_RESOURCES line itself is only needed
statically because no resource file is needed for dynamic libraries so it
is protected with the QT_STATIC define.
Task-number: QTBUG-35754
Change-Id: I9059e10c0846548f365fe4f95dd9c6100eeb43cd
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/imports/localstorage')
-rw-r--r-- | src/imports/localstorage/plugin.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp index ada50774a7..5b55a2711f 100644 --- a/src/imports/localstorage/plugin.cpp +++ b/src/imports/localstorage/plugin.cpp @@ -54,6 +54,13 @@ #include <private/qv4scopedvalue_p.h> #include <private/qv4objectiterator_p.h> +static void initResources() +{ +#ifdef QT_STATIC + Q_INIT_RESOURCE(qmake_QtQuick_LocalStorage); +#endif +} + QT_BEGIN_NAMESPACE #define V4THROW_SQL(error, desc) { \ @@ -744,10 +751,10 @@ class QQmlLocalStoragePlugin : public QQmlExtensionPlugin Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") public: - QQmlLocalStoragePlugin() + QQmlLocalStoragePlugin(QObject *parent = 0) : QQmlExtensionPlugin(parent) { + initResources(); } - void registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == "QtQuick.LocalStorage"); |