diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2018-02-09 14:29:21 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2018-03-20 08:19:25 +0000 |
commit | 5a4787dca01c302dd462a76222dfbf28c8951a8d (patch) | |
tree | 897b7caea659526d740e98c06b11c15970d35a7b /src/corelib/kernel/qmetatype.cpp | |
parent | dd74f5d347d0a5a21527142f85114374e2d90646 (diff) |
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 <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetatype.cpp')
-rw-r--r-- | src/corelib/kernel/qmetatype.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index 5abc2ebd70..518381712a 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -53,12 +53,15 @@ #include "qdatastream.h" #include "qmetatypeswitcher_p.h" +#if QT_CONFIG(regularexpression) +# include "qregularexpression.h" +#endif + #ifndef QT_BOOTSTRAPPED # include "qbitarray.h" # include "qurl.h" # include "qvariant.h" # include "qabstractitemmodel.h" -# include "qregularexpression.h" # include "qjsonvalue.h" # include "qjsonobject.h" # include "qjsonarray.h" @@ -1481,12 +1484,12 @@ bool QMetaType::save(QDataStream &stream, int type, const void *data) stream << *static_cast<const NS(QRegExp)*>(data); break; #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) case QMetaType::QRegularExpression: stream << *static_cast<const NS(QRegularExpression)*>(data); break; -#endif // QT_NO_REGULAREXPRESSION +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED case QMetaType::QEasingCurve: stream << *static_cast<const NS(QEasingCurve)*>(data); break; @@ -1711,12 +1714,12 @@ bool QMetaType::load(QDataStream &stream, int type, void *data) stream >> *static_cast< NS(QRegExp)*>(data); break; #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) case QMetaType::QRegularExpression: stream >> *static_cast< NS(QRegularExpression)*>(data); break; -#endif // QT_NO_REGULAREXPRESSION +#endif // QT_CONFIG(regularexpression) +#ifndef QT_BOOTSTRAPPED case QMetaType::QEasingCurve: stream >> *static_cast< NS(QEasingCurve)*>(data); break; |