summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-05-27 10:52:32 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-11 06:52:03 +0200
commit4895ae10c6783f039737f2aff9c2ae8006d303eb (patch)
tree64f104f7accbbc8744b2ea245fd49f1cc88f74a5
parentd984adac68a70c0a23b411b103a4c8d777d6fb0d (diff)
Port QtSql from QStringRef to QStringView
Task-number: QTBUG-84319 Change-Id: Icc9b955dae1aa13b16c01e26192cb82f828903b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp2
-rw-r--r--src/sql/kernel/qsqlrecord.cpp8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
index 27e7d02472..e900ccf5ec 100644
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
@@ -720,7 +720,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
int regexpCacheSize = 25;
#endif
- const auto opts = conOpts.splitRef(QLatin1Char(';'));
+ const auto opts = QStringView{conOpts}.split(QLatin1Char(';'));
for (auto option : opts) {
option = option.trimmed();
if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT"))) {
diff --git a/src/sql/kernel/qsqlrecord.cpp b/src/sql/kernel/qsqlrecord.cpp
index c4dc5d1adb..1c3e03fecf 100644
--- a/src/sql/kernel/qsqlrecord.cpp
+++ b/src/sql/kernel/qsqlrecord.cpp
@@ -232,12 +232,12 @@ QString QSqlRecord::fieldName(int index) const
int QSqlRecord::indexOf(const QString& name) const
{
- QStringRef tableName;
- QStringRef fieldName(&name);
+ QStringView tableName;
+ QStringView fieldName(name);
const int idx = name.indexOf(QLatin1Char('.'));
if (idx != -1) {
- tableName = name.leftRef(idx);
- fieldName = name.midRef(idx + 1);
+ tableName = fieldName.left(idx);
+ fieldName = fieldName.mid(idx + 1);
}
const int cnt = count();
for (int i = 0; i < cnt; ++i) {