From befd198c15b7a2b95f539372d2557063b6b397a6 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Sun, 15 Mar 2020 14:52:43 +0100 Subject: Remove QRegExp usage from the the OCI plugin Change-Id: I95009b5bc6f9ce4356e707e07c5cb7346aaf9245 Reviewed-by: Samuel Gaist Reviewed-by: Maurice Kalinowski --- src/plugins/sqldrivers/oci/qsql_oci.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/sqldrivers/oci/qsql_oci.cpp b/src/plugins/sqldrivers/oci/qsql_oci.cpp index 8da9837a59..66ee890734 100644 --- a/src/plugins/sqldrivers/oci/qsql_oci.cpp +++ b/src/plugins/sqldrivers/oci/qsql_oci.cpp @@ -43,7 +43,9 @@ #include #include #include -#include +#if QT_CONFIG(regularexpression) +#include +#endif #include #include #include @@ -2335,9 +2337,11 @@ bool QOCIDriver::open(const QString & db, } else { QString versionStr; versionStr = QString(reinterpret_cast(vertxt)); - QRegExp vers(QLatin1String("([0-9]+)\\.[0-9\\.]+[0-9]")); - if (vers.indexIn(versionStr) >= 0) - d->serverVersion = vers.cap(1).toInt(); +#if QT_CONFIG(regularexpression) + auto match = QRegularExpression(QLatin1String("([0-9]+)\\.[0-9\\.]+[0-9]")).match(versionStr); + if (match.hasMatch()) + d->serverVersion = vers.captured(1).toInt(); +#endif if (d->serverVersion == 0) d->serverVersion = -1; } -- cgit v1.2.3