diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2018-06-26 22:46:49 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2018-09-01 15:19:39 +0000 |
commit | d9766ddc3d525cf08acec4c3483e61d86c9899a8 (patch) | |
tree | 755b9c9181a24cbc1663714e888e2e3f4cd4db45 /src/corelib/plugin/qfactoryloader_p.h | |
parent | 7391662f80470549b9f9c182da43cf433efabdf7 (diff) |
Plugins: store the metadata in CBOR instead of binary JSON
In preparation for Qt 6 deprecating the binary JSON format. Also reduces
the size of the metadata a little: for the xcb platform plugin, it went
down from 264 bytes to 138; for the jpeg image plugin, it went from 320
to 135.
I've had to change the signature so older versions of Qt won't try to
parse the CBOR data as Binary JSON. Unfortunately, before QJsonDocument
could get a chance to reject it, qJsonFromRawLibraryMetaData() needed to
allocate memory and that causes crashes with Qt < 5.11.2.
Change-Id: Ieb48f7c0dd0e4e0fb35efffd153bee34e16ce347
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/plugin/qfactoryloader_p.h')
-rw-r--r-- | src/corelib/plugin/qfactoryloader_p.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/plugin/qfactoryloader_p.h b/src/corelib/plugin/qfactoryloader_p.h index fe722999ae..7815ea0b5d 100644 --- a/src/corelib/plugin/qfactoryloader_p.h +++ b/src/corelib/plugin/qfactoryloader_p.h @@ -56,6 +56,7 @@ #include "QtCore/qobject.h" #include "QtCore/qstringlist.h" +#include "QtCore/qcborvalue.h" #include "QtCore/qjsonobject.h" #include "QtCore/qjsondocument.h" #include "QtCore/qmap.h" @@ -66,7 +67,7 @@ QT_BEGIN_NAMESPACE -QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype size); +QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype size, QString *errMsg); class QFactoryLoaderPrivate; class Q_CORE_EXPORT QFactoryLoader : public QObject |