Port QtSql from QStringRef to QStringView
Task-number: QTBUG-84319 Change-Id: Icc9b955dae1aa13b16c01e26192cb82f828903b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
d984adac68
commit
4895ae10c6
@ -720,7 +720,7 @@ bool QSQLiteDriver::open(const QString & db, const QString &, const QString &, c
|
|||||||
int regexpCacheSize = 25;
|
int regexpCacheSize = 25;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const auto opts = conOpts.splitRef(QLatin1Char(';'));
|
const auto opts = QStringView{conOpts}.split(QLatin1Char(';'));
|
||||||
for (auto option : opts) {
|
for (auto option : opts) {
|
||||||
option = option.trimmed();
|
option = option.trimmed();
|
||||||
if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT"))) {
|
if (option.startsWith(QLatin1String("QSQLITE_BUSY_TIMEOUT"))) {
|
||||||
|
@ -232,12 +232,12 @@ QString QSqlRecord::fieldName(int index) const
|
|||||||
|
|
||||||
int QSqlRecord::indexOf(const QString& name) const
|
int QSqlRecord::indexOf(const QString& name) const
|
||||||
{
|
{
|
||||||
QStringRef tableName;
|
QStringView tableName;
|
||||||
QStringRef fieldName(&name);
|
QStringView fieldName(name);
|
||||||
const int idx = name.indexOf(QLatin1Char('.'));
|
const int idx = name.indexOf(QLatin1Char('.'));
|
||||||
if (idx != -1) {
|
if (idx != -1) {
|
||||||
tableName = name.leftRef(idx);
|
tableName = fieldName.left(idx);
|
||||||
fieldName = name.midRef(idx + 1);
|
fieldName = fieldName.mid(idx + 1);
|
||||||
}
|
}
|
||||||
const int cnt = count();
|
const int cnt = count();
|
||||||
for (int i = 0; i < cnt; ++i) {
|
for (int i = 0; i < cnt; ++i) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user