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/tools/qstringlist.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/corelib/tools/qstringlist.cpp') diff --git a/src/corelib/tools/qstringlist.cpp b/src/corelib/tools/qstringlist.cpp index 17f6bd8539..d10d9ad9d0 100644 --- a/src/corelib/tools/qstringlist.cpp +++ b/src/corelib/tools/qstringlist.cpp @@ -39,7 +39,9 @@ #include #include -#include +#if QT_CONFIG(regularexpression) +# include +#endif #include @@ -361,8 +363,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegExp } #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) /*! \fn QStringList QStringList::filter(const QRegularExpression &re) const \overload @@ -380,8 +381,7 @@ QStringList QtPrivate::QStringList_filter(const QStringList *that, const QRegula } return res; } -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) /*! \fn QStringList &QStringList::replaceInStrings(const QString &before, const QString &after, Qt::CaseSensitivity cs) @@ -436,8 +436,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegExp &r } #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) /*! \fn QStringList &QStringList::replaceInStrings(const QRegularExpression &re, const QString &after) \overload @@ -466,8 +465,7 @@ void QtPrivate::QStringList_replaceInStrings(QStringList *that, const QRegularEx for (int i = 0; i < that->size(); ++i) (*that)[i].replace(re, after); } -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) static int accumulatedSize(const QStringList &list, int seplen) { @@ -674,8 +672,7 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, QRegExp &rx, int } #endif -#ifndef QT_BOOTSTRAPPED -#ifndef QT_NO_REGULAREXPRESSION +#if QT_CONFIG(regularexpression) /*! \fn int QStringList::indexOf(const QRegularExpression &re, int from) const \overload @@ -732,8 +729,7 @@ int QtPrivate::QStringList_lastIndexOf(const QStringList *that, const QRegularEx } return -1; } -#endif // QT_NO_REGULAREXPRESSION -#endif // QT_BOOTSTRAPPED +#endif // QT_CONFIG(regularexpression) /*! \fn int QStringList::removeDuplicates() -- cgit v1.2.3