From 529f052add3edbc1afb063a5cbbb118b67434fb6 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 31 May 2020 18:04:04 +0200 Subject: Port QRegularExpression to QStringView, drop QStringRef The idea is pretty simple -- add QRegularExpression matching over QStringView. When matching over a QString, keep the string alive (by taking a copy), and set the view onto that string. Otherwise, just use the view provided by the user (who is then responsible for ensuring the data stays valid while matching). Do just minor refactorings to support this use case in a cleaner fashion. In QRegularExpressionMatch drop the QStringRef-returning methods, as they cannot work any more -- in the general case there won't be a QString to build a QStringRef from. [ChangeLog][QtCore][QRegularExpression] All the APIs dealing with QStringRef have been ported to QStringView, following QStringRef deprecation in Qt 6.0. Change-Id: Ic367991d9583cc108c045e4387c9b7288c8f1ffd Reviewed-by: Lars Knoll --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins/sqldrivers/psql/qsql_psql.cpp') diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index 6a1df3a94a9..3424400cc19 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -1066,14 +1066,14 @@ static QPSQLDriver::Protocol qFindPSQLVersion(const QString &versionString) // increasing the first part of the version, e.g. 10 to 11. // Before version 10, a major release was indicated by increasing either // the first or second part of the version number, e.g. 9.5 to 9.6. - int vMaj = match.capturedRef(1).toInt(); + int vMaj = match.capturedView(1).toInt(); int vMin; if (vMaj >= 10) { vMin = 0; } else { - if (match.capturedRef(2).isEmpty()) + if (match.capturedView(2).isEmpty()) return QPSQLDriver::VersionUnknown; - vMin = match.capturedRef(2).toInt(); + vMin = match.capturedView(2).toInt(); } return qMakePSQLVersion(vMaj, vMin); } -- cgit v1.2.3