Fix warning: "Use midRef() instead of mid()"

[-Wclazy-qstring-ref]

Change-Id: If8a0844b39377feb3772542559655854a92b93cd
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2019-01-17 01:38:54 +01:00
parent 8acd583d10
commit 710e57a628
19 changed files with 38 additions and 38 deletions

View File

@@ -159,8 +159,8 @@ static QString sanitizeBlameOutput(const QString &b)
forever {
QTC_CHECK(prevPos < pos);
int afterParen = prevPos + parenPos;
result.append(b.mid(prevPos, stripPos));
result.append(b.mid(afterParen, pos - afterParen));
result.append(b.midRef(prevPos, stripPos));
result.append(b.midRef(afterParen, pos - afterParen));
prevPos = pos;
QTC_CHECK(prevPos != 0);
if (pos == b.size())

View File

@@ -106,7 +106,7 @@ public:
filePath.remove(0, m_ref.length());
single.fileName = m_directory + '/' + filePath;
const int textSeparator = line.indexOf(QChar::Null, lineSeparator + 1);
single.lineNumber = line.mid(lineSeparator + 1, textSeparator - lineSeparator - 1).toInt();
single.lineNumber = line.midRef(lineSeparator + 1, textSeparator - lineSeparator - 1).toInt();
QString text = line.mid(textSeparator + 1);
QRegularExpression regexp;
QVector<Match> matches;