summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-03-15 14:52:43 +0100
committerLars Knoll <lars.knoll@qt.io>2020-03-17 08:35:35 +0100
commitbefd198c15b7a2b95f539372d2557063b6b397a6 (patch)
tree0121c9e576a39bd54ec57df3f688bd485c4af8e4 /src
parentb798b2cbb4061243762531c7eef37de165ced949 (diff)
Remove QRegExp usage from the the OCI plugin
Change-Id: I95009b5bc6f9ce4356e707e07c5cb7346aaf9245 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/sqldrivers/oci/qsql_oci.cpp12
1 files changed, 8 insertions, 4 deletions
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 <qvariant.h>
#include <qdatetime.h>
#include <qmetatype.h>
-#include <qregexp.h>
+#if QT_CONFIG(regularexpression)
+#include <qregularexpression.h>
+#endif
#include <qshareddata.h>
#include <qsqlerror.h>
#include <qsqlfield.h>
@@ -2335,9 +2337,11 @@ bool QOCIDriver::open(const QString & db,
} else {
QString versionStr;
versionStr = QString(reinterpret_cast<const QChar *>(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;
}