summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-02-15 11:23:24 +0100
committerUlf Hermann <ulf.hermann@qt.io>2017-02-22 17:36:32 +0000
commit4e9f7807fbca948f355fa6aa17e0bbeb86d065a3 (patch)
tree95cb5d32db463238b90666103e924bdf09b2c145 /src
parent4c367833b4c1776f01eff3d51472a9889c85e1c5 (diff)
Move qJsonFromRawLibraryMetaData into qfactoryloader_p.h
This is still not a great place for it, but this way we can Q_REQUIRE_CONFIG(library) in qlibrary_p.h and qfactoryloader_p.h is the only private header that doesn't require library support in plugin.pri. Change-Id: Ia6c1ac8799822eca1e0cbeca98d1c1b8de74beae Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/plugin/qfactoryloader_p.h11
-rw-r--r--src/corelib/plugin/qlibrary.cpp1
-rw-r--r--src/corelib/plugin/qlibrary_p.h13
-rw-r--r--src/corelib/plugin/qpluginloader.cpp2
4 files changed, 13 insertions, 14 deletions
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h
index 0876d141c4..70a934c976 100644
--- a/src/corelib/plugin/qfactoryloader_p.h
+++ b/src/corelib/plugin/qfactoryloader_p.h
@@ -57,11 +57,22 @@
#include "QtCore/qobject.h"
#include "QtCore/qstringlist.h"
#include "QtCore/qjsonobject.h"
+#include "QtCore/qjsondocument.h"
#include "QtCore/qmap.h"
+#include "QtCore/qendian.h"
#include "private/qlibrary_p.h"
QT_BEGIN_NAMESPACE
+inline QJsonDocument qJsonFromRawLibraryMetaData(const char *raw)
+{
+ raw += strlen("QTMETADATA ");
+ // the size of the embedded JSON object can be found 8 bytes into the data (see qjson_p.h),
+ // but doesn't include the size of the header (8 bytes)
+ QByteArray json(raw, qFromLittleEndian<uint>(*(const uint *)(raw + 8)) + 8);
+ return QJsonDocument::fromBinaryData(json);
+}
+
class QFactoryLoaderPrivate;
class Q_CORE_EXPORT QFactoryLoader : public QObject
{
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 96cf5371f9..a4a654cd88 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -42,6 +42,7 @@
#ifndef QT_NO_LIBRARY
+#include "qfactoryloader_p.h"
#include "qlibrary_p.h"
#include <qstringlist.h>
#include <qfile.h>
diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h
index f883e74843..7147ff6ca2 100644
--- a/src/corelib/plugin/qlibrary_p.h
+++ b/src/corelib/plugin/qlibrary_p.h
@@ -58,25 +58,12 @@
#include "QtCore/qstringlist.h"
#include "QtCore/qplugin.h"
#include "QtCore/qsharedpointer.h"
-#include "QtCore/qjsonobject.h"
-#include "QtCore/qjsondocument.h"
-#include "QtCore/qendian.h"
#ifdef Q_OS_WIN
# include "QtCore/qt_windows.h"
#endif
QT_BEGIN_NAMESPACE
-// Needed also in case of QT_NO_LIBRARY, for static plugin loading.
-inline QJsonDocument qJsonFromRawLibraryMetaData(const char *raw)
-{
- raw += strlen("QTMETADATA ");
- // the size of the embedded JSON object can be found 8 bytes into the data (see qjson_p.h),
- // but doesn't include the size of the header (8 bytes)
- QByteArray json(raw, qFromLittleEndian<uint>(*(const uint *)(raw + 8)) + 8);
- return QJsonDocument::fromBinaryData(json);
-}
-
#ifndef QT_NO_LIBRARY
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 4ec4e43952..6723877ad5 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -43,7 +43,7 @@
#include "qcoreapplication.h"
#include "qpluginloader.h"
#include <qfileinfo.h>
-#include "qlibrary_p.h"
+#include "qfactoryloader_p.h"
#include "qdebug.h"
#include "qdir.h"