QPlugin/QFactoryLoader: remove Qt 5 plugin remnants

Qt 6.x does not need to be able to read the old Qt 5-based binary JSON
metadata. The QT_WARNING_DISABLE_DEPRECATED was needed in 5.15 while we
used the then-deprecated functions to decode.

Pick-to: 6.2
Change-Id: I2de1b4dfacd443148279fffd16a39ee074da3ef4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
bb10
Thiago Macieira 2021-09-10 18:02:56 -07:00
parent ae36509d5c
commit a7fa677fc2
2 changed files with 0 additions and 40 deletions

View File

@ -126,8 +126,6 @@ static QJsonDocument jsonFromCborMetaData(const char *raw, qsizetype size, QStri
return QJsonDocument(o);
}
QT_WARNING_PUSH
QT_WARNING_DISABLE_DEPRECATED
QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype sectionSize, QString *errMsg)
{
raw += metaDataSignatureLength();
@ -135,7 +133,6 @@ QJsonDocument qJsonFromRawLibraryMetaData(const char *raw, qsizetype sectionSize
return jsonFromCborMetaData(raw, sectionSize, errMsg);
}
QT_WARNING_POP
class QFactoryLoaderPrivate : public QObjectPrivate
{

View File

@ -137,43 +137,6 @@ void tst_QPlugin::scanInvalidPlugin_data()
QTest::addColumn<bool>("loads");
QTest::addColumn<QString>("errMsg");
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// Binary JSON metadata
QByteArray prefix = "QTMETADATA ";
{
QJsonObject obj;
obj.insert("IID", "org.qt-project.tst_qplugin");
obj.insert("className", "tst");
obj.insert("version", int(QT_VERSION));
#ifdef QT_NO_DEBUG
obj.insert("debug", false);
#else
obj.insert("debug", true);
#endif
obj.insert("MetaData", QJsonObject());
QTest::newRow("json-control") << (prefix + QJsonDocument(obj).toBinaryData()) << true << "";
}
QTest::newRow("json-zeroes") << prefix << false << " ";
prefix += "qbjs";
QTest::newRow("bad-json-version0") << prefix << false << " ";
QTest::newRow("bad-json-version2") << (prefix + QByteArray("\2\0\0\0", 4)) << false << " ";
// valid qbjs version 1
prefix += QByteArray("\1\0\0\0");
// too large for the file (100 MB)
QTest::newRow("bad-json-size-large1") << (prefix + QByteArray("\0\0\x40\x06")) << false << " ";
// too large for binary JSON (512 MB)
QTest::newRow("bad-json-size-large2") << (prefix + QByteArray("\0\0\0\x20")) << false << " ";
// could overflow
QTest::newRow("bad-json-size-large3") << (prefix + "\xff\xff\xff\x7f") << false << " ";
#endif
// CBOR metadata
QByteArray cprefix = "QTMETADATA !1234";
cprefix[12] = 0; // current version