From 4f28ec6c8526d754849bd26c55e4c5faf61f4eb0 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Thu, 14 Mar 2019 10:32:10 +0100 Subject: [PATCH 2/3] Revert "qtlite: Fix build libs with -no-feature-regularexpression" This reverts commit 3b514f853595c686d4ed8830567c1f27ea533faf. --- src/corelib/kernel/qvariant.cpp | 4 ---- src/corelib/serialization/qcborvalue.cpp | 12 ------------ src/corelib/serialization/qcborvalue.h | 10 +--------- src/corelib/serialization/qjsoncbor.cpp | 7 ------- .../platforms/eglfs/api/qeglfsdeviceintegration.cpp | 4 +--- .../xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 6 +----- src/testlib/qtaptestlogger.cpp | 11 +---------- 7 files changed, 4 insertions(+), 50 deletions(-) Index: qtbase-everywhere-src-5.13.0-beta2/src/corelib/kernel/qvariant.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/corelib/kernel/qvariant.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/corelib/kernel/qvariant.cpp @@ -1052,13 +1052,11 @@ static bool convert(const QVariant::Priv return false; #ifndef QT_BOOTSTRAPPED -#if QT_CONFIG(regularexpression) case QMetaType::QRegularExpression: if (d->type != QMetaType::QCborValue || !v_cast(d)->isRegularExpression()) return false; *static_cast(result) = v_cast(d)->toRegularExpression(); break; -#endif case QMetaType::QJsonValue: switch (d->type) { case QMetaType::Nullptr: @@ -1234,11 +1232,9 @@ static bool convert(const QVariant::Priv case QVariant::Url: *static_cast(result) = QCborValue(*v_cast(d)); break; -#if QT_CONFIG(regularexpression) case QVariant::RegularExpression: *static_cast(result) = QCborValue(*v_cast(d)); break; -#endif case QVariant::Uuid: *static_cast(result) = QCborValue(*v_cast(d)); break; Index: qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qcborvalue.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/corelib/serialization/qcborvalue.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qcborvalue.cpp @@ -1772,7 +1772,6 @@ QCborValue::QCborValue(const QUrl &url) container->elements[1].type = String; } -#if QT_CONFIG(regularexpression) /*! Creates a QCborValue object of the regular expression pattern extended type and containing the value represented by \a rx. The value can later be retrieved @@ -1791,7 +1790,6 @@ QCborValue::QCborValue(const QRegularExp // change type t = RegularExpression; } -#endif // QT_CONFIG(regularexpression) /*! Creates a QCborValue object of the UUID extended type and containing the @@ -1945,7 +1943,6 @@ QUrl QCborValue::toUrl(const QUrl &defau return QUrl::fromEncoded(byteData->asByteArrayView()); } -#if QT_CONFIG(regularexpression) /*! Returns the regular expression value stored in this QCborValue, if it is of the regular expression pattern extended type. Otherwise, it returns \a @@ -1964,7 +1961,6 @@ QRegularExpression QCborValue::toRegular Q_ASSERT(n == -1); return QRegularExpression(container->stringAt(1)); } -#endif // QT_CONFIG(regularexpression) /*! Returns the UUID value stored in this QCborValue, if it is of the UUID @@ -2874,16 +2870,12 @@ uint qHash(const QCborValue &value, uint return qHash(value.toDateTime(), seed); case QCborValue::Url: return qHash(value.toUrl(), seed); -#if QT_CONFIG(regularexpression) case QCborValue::RegularExpression: return qHash(value.toRegularExpression(), seed); -#endif case QCborValue::Uuid: return qHash(value.toUuid(), seed); case QCborValue::Invalid: return seed; - default: - break; } Q_ASSERT(value.isSimpleType()); @@ -2928,16 +2920,12 @@ static QDebug debugContents(QDebug &dbg, return dbg << v.toDateTime(); case QCborValue::Url: return dbg << v.toUrl(); -#if QT_CONFIG(regularexpression) case QCborValue::RegularExpression: return dbg << v.toRegularExpression(); -#endif case QCborValue::Uuid: return dbg << v.toUuid(); case QCborValue::Invalid: return dbg << ""; - default: - break; } if (v.isSimpleType()) return dbg << v.toSimpleType(); Index: qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qcborvalue.h =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/corelib/serialization/qcborvalue.h +++ qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qcborvalue.h @@ -43,9 +43,7 @@ #include #include #include -#if QT_CONFIG(regularexpression) -# include -#endif +#include #include #include #include @@ -159,9 +157,7 @@ public: explicit QCborValue(const QDateTime &dt); explicit QCborValue(const QUrl &url); -#if QT_CONFIG(regularexpression) explicit QCborValue(const QRegularExpression &rx); -#endif explicit QCborValue(const QUuid &uuid); ~QCborValue() { if (container) dispose(); } @@ -239,9 +235,7 @@ public: QString toString(const QString &defaultValue = {}) const; QDateTime toDateTime(const QDateTime &defaultValue = {}) const; QUrl toUrl(const QUrl &defaultValue = {}) const; -#if QT_CONFIG(regularexpression) QRegularExpression toRegularExpression(const QRegularExpression &defaultValue = {}) const; -#endif QUuid toUuid(const QUuid &defaultValue = {}) const; // only forward-declared, need split functions @@ -386,10 +380,8 @@ public: { return concrete().toDateTime(defaultValue); } QUrl toUrl(const QUrl &defaultValue = {}) const { return concrete().toUrl(defaultValue); } -#if QT_CONFIG(regularexpression) QRegularExpression toRegularExpression(const QRegularExpression &defaultValue = {}) const { return concrete().toRegularExpression(defaultValue); } -#endif QUuid toUuid(const QUuid &defaultValue = {}) const { return concrete().toUuid(defaultValue); } Index: qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qjsoncbor.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/corelib/serialization/qjsoncbor.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/corelib/serialization/qjsoncbor.cpp @@ -543,19 +543,14 @@ QVariant QCborValue::toVariant() const case Url: return toUrl(); -#if QT_CONFIG(regularexpression) case RegularExpression: return toRegularExpression(); -#endif case Uuid: return toUuid(); case Invalid: return QVariant(); - - default: - break; } if (isSimpleType()) @@ -719,10 +714,8 @@ QCborValue QCborValue::fromVariant(const case QVariant::Hash: return QCborMap::fromVariantHash(variant.toHash()); #ifndef QT_BOOTSTRAPPED -#if QT_CONFIG(regularexpression) case QVariant::RegularExpression: return QCborValue(variant.toRegularExpression()); -#endif case QMetaType::QJsonValue: return fromJsonValue(variant.toJsonValue()); case QMetaType::QJsonObject: Index: qtbase-everywhere-src-5.13.0-beta2/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration.cpp @@ -51,9 +51,7 @@ #include #include #include -#if QT_CONFIG(regularexpression) -# include -#endif +#include #include #if defined(Q_OS_LINUX) Index: qtbase-everywhere-src-5.13.0-beta2/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -48,9 +48,7 @@ #undef register #include -#if QT_CONFIG(regularexpression) -# include -#endif +#include #include #include @@ -724,7 +722,6 @@ void QGLXContext::queryDummyContext() // The issue was fixed in Xcb 1.11, but we can't check for that // at runtime, so instead assume it fixed with recent Mesa versions // released several years after the Xcb fix. -#if QT_CONFIG(regularexpression) QRegularExpression versionTest(QStringLiteral("Mesa (\\d+)")); QRegularExpressionMatch result = versionTest.match(QString::fromLatin1(mesaVersionStr)); int versionNr = 0; @@ -734,7 +731,6 @@ void QGLXContext::queryDummyContext() // White-listed m_supportsThreading = true; } -#endif } if (!m_supportsThreading) { qCDebug(lcQpaGl).nospace() << "Multithreaded OpenGL disabled: " Index: qtbase-everywhere-src-5.13.0-beta2/src/testlib/qtaptestlogger.cpp =================================================================== --- qtbase-everywhere-src-5.13.0-beta2.orig/src/testlib/qtaptestlogger.cpp +++ qtbase-everywhere-src-5.13.0-beta2/src/testlib/qtaptestlogger.cpp @@ -43,9 +43,7 @@ #include "qtestresult_p.h" #include "qtestassert.h" -#if QT_CONFIG(regularexpression) -# include -#endif +#include QT_BEGIN_NAMESPACE @@ -150,7 +148,6 @@ void QTapTestLogger::addIncident(Inciden outputString(YAML_INDENT "---\n"); if (type != XFail) { -#if QT_CONFIG(regularexpression) // This is fragile, but unfortunately testlib doesn't plumb // the expected and actual values to the loggers (yet). static QRegularExpression verifyRegex( @@ -211,12 +208,6 @@ void QTapTestLogger::addIncident(Inciden YAML_INDENT "# %s\n", description); outputString(unparsableDescription.data()); } -#else - QTestCharBuffer unparsableDescription; - QTest::qt_asprintf(&unparsableDescription, - YAML_INDENT "# %s\n", description); - outputString(unparsableDescription.data()); -#endif } if (file) {