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/tools/qstringlist.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/tools/qstringlist.cpp')
-rw-r--r-- | src/corelib/tools/qstringlist.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
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 <qstringlist.h> #include <qset.h> -#include <qregularexpression.h> +#if QT_CONFIG(regularexpression) +# include <qregularexpression.h> +#endif #include <algorithm> @@ -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() |