From 3df1aae3a522a99fba2a6a22ded01529f9a9c4da Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 11 Jun 2015 17:57:56 +0200 Subject: Don't try to load (or unload) QML plugins if QT_NO_LIBRARY Most of the code already has those #ifdefs, so let's add the missing ones. Change-Id: I2a46d5ab660daa837d9ce432184d0b55818a5dc1 Reviewed-by: Simon Hausmann --- src/qml/qml/qqmlimport.cpp | 7 ++++++- src/qml/qml/qqmlmetatype.cpp | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qml/qml/qqmlimport.cpp b/src/qml/qml/qqmlimport.cpp index cb23042d64..87ee8078f4 100644 --- a/src/qml/qml/qqmlimport.cpp +++ b/src/qml/qml/qqmlimport.cpp @@ -169,6 +169,7 @@ QQmlType *getTypeForUrl(const QString &urlString, const QHashedStringRef& typeNa } // namespace +#ifndef QT_NO_LIBRARY struct RegisteredPlugin { QString uri; QPluginLoader* loader; @@ -193,6 +194,7 @@ void qmlClearEnginePlugins() } typedef QPair StaticPluginPair; +#endif class QQmlImportNamespace { @@ -292,9 +294,10 @@ public: const QString &uri, const QString &url, int vmaj, int vmin, QV4::CompiledData::Import::ImportType type, QList *errors, bool lowPrecedence = false); - +#ifndef QT_NO_LIBRARY bool populatePluginPairVector(QVector &result, const QString &uri, const QString &qmldirPath, QList *errors); +#endif }; /*! @@ -826,6 +829,7 @@ QQmlImportNamespace *QQmlImportsPrivate::findQualifiedNamespace(const QHashedStr } +#ifndef QT_NO_LIBRARY /*! Get all static plugins that are QML plugins and has a meta data URI that begins with \a uri. Note that if e.g uri == "a", and different plugins have meta data "a", "a.2.1", "a.b.c", all @@ -869,6 +873,7 @@ bool QQmlImportsPrivate::populatePluginPairVector(QVector &res } return true; } +#endif /*! Import an extension defined by a qmldir file. diff --git a/src/qml/qml/qqmlmetatype.cpp b/src/qml/qml/qqmlmetatype.cpp index 249ce6942f..55df65e607 100644 --- a/src/qml/qml/qqmlmetatype.cpp +++ b/src/qml/qml/qqmlmetatype.cpp @@ -1107,7 +1107,9 @@ void qmlClearTypeRegistrations() // Declared in qqml.h data->uriToModule.clear(); QQmlEnginePrivate::baseModulesUninitialized = true; //So the engine re-registers its types +#ifndef QT_NO_LIBRARY qmlClearEnginePlugins(); +#endif } int registerAutoParentFunction(QQmlPrivate::RegisterAutoParent &autoparent) -- cgit v1.2.3