summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-02-12 02:38:20 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-03-13 15:23:56 +0100
commit2537d047857db9f686e66c1e464b4742c23756b3 (patch)
tree64ef711d722d67aa07d45fc627810a7f5bea2b95
parent75514103e2f1cb7dc6b238d696b228e8f64a00ec (diff)
QRegularExpression: inline some compatibility calls
The functions take QStringView now. The ones taking QString can be implemented inline (BC break). Drive-by change, use qToStringViewIgnoringNull. Change-Id: Ia3089c574446418e5ab93e08e21869ef19fbfbfd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qregularexpression.cpp12
-rw-r--r--src/corelib/text/qregularexpression.h14
2 files changed, 13 insertions, 13 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index d74b759aa9..003bc59e1c 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -1831,12 +1831,9 @@ uint qHash(const QRegularExpression &key, uint seed) noexcept
#if QT_STRINGVIEW_LEVEL < 2
/*!
+ \fn QString QRegularExpression::escape(const QString &str)
\overload
*/
-QString QRegularExpression::escape(const QString &str)
-{
- return escape(QStringView(str));
-}
#endif // QT_STRINGVIEW_LEVEL < 2
/*!
@@ -1897,12 +1894,9 @@ QString QRegularExpression::escape(QStringView str)
#if QT_STRINGVIEW_LEVEL < 2
/*!
\since 5.12
+ \fn QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
\overload
*/
-QString QRegularExpression::wildcardToRegularExpression(const QString &pattern)
-{
- return wildcardToRegularExpression(QStringView(pattern));
-}
#endif // QT_STRINGVIEW_LEVEL < 2
/*!
@@ -2036,9 +2030,7 @@ QString QRegularExpression::wildcardToRegularExpression(QStringView pattern)
#if QT_STRINGVIEW_LEVEL < 2
/*!
\fn QRegularExpression::anchoredPattern(const QString &expression)
-
\since 5.12
-
\overload
*/
#endif // QT_STRINGVIEW_LEVEL < 2
diff --git a/src/corelib/text/qregularexpression.h b/src/corelib/text/qregularexpression.h
index 4fa258b080..9e703a4eea 100644
--- a/src/corelib/text/qregularexpression.h
+++ b/src/corelib/text/qregularexpression.h
@@ -138,11 +138,19 @@ public:
void optimize() const;
#if QT_STRINGVIEW_LEVEL < 2
- static QString escape(const QString &str);
- static QString wildcardToRegularExpression(const QString &str);
+ static QString escape(const QString &str)
+ {
+ return escape(qToStringViewIgnoringNull(str));
+ }
+
+ static QString wildcardToRegularExpression(const QString &str)
+ {
+ return wildcardToRegularExpression(qToStringViewIgnoringNull(str));
+ }
+
static inline QString anchoredPattern(const QString &expression)
{
- return anchoredPattern(QStringView(expression));
+ return anchoredPattern(qToStringViewIgnoringNull(expression));
}
#endif