From 5a4787dca01c302dd462a76222dfbf28c8951a8d Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 9 Feb 2018 14:29:21 +0100 Subject: Modernize the "regularexpression" feature Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qvariant.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/corelib/kernel/qvariant.cpp') diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index f77831c703..c3c36e05d7 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -48,7 +48,9 @@ #include "qdatetime.h" #include "qeasingcurve.h" #include "qlist.h" +#if QT_CONFIG(regularexpression) #include "qregularexpression.h" +#endif #include "qstring.h" #include "qstringlist.h" #include "qurl.h" @@ -1941,12 +1943,12 @@ QVariant::QVariant(const QRegExp ®Exp) : d(RegExp) { v_construct(&d, regExp); } #endif // QT_NO_REGEXP -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) QVariant::QVariant(const QRegularExpression &re) : d(RegularExpression) { v_construct(&d, re); } -#endif +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED QVariant::QVariant(const QUuid &uuid) : d(Uuid) { v_construct(&d, uuid); } @@ -2650,7 +2652,7 @@ QRegExp QVariant::toRegExp() const } #endif -#ifndef QT_BOOTSTRAPPED +#if QT_CONFIG(regularexpression) /*! \fn QRegularExpression QVariant::toRegularExpression() const \since 5.0 @@ -2660,13 +2662,13 @@ QRegExp QVariant::toRegExp() const \sa canConvert(), convert() */ -#ifndef QT_NO_REGULAREXPRESSION QRegularExpression QVariant::toRegularExpression() const { return qVariantToHelper(d, handlerManager); } -#endif // QT_NO_REGULAREXPRESSION +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED /*! \since 5.0 @@ -2758,7 +2760,7 @@ QJsonDocument QVariant::toJsonDocument() const { return qVariantToHelper(d, handlerManager); } -#endif +#endif // QT_BOOTSTRAPPED /*! \fn QChar QVariant::toChar() const -- cgit v1.2.3