migrate QStringRef -> QStringView (#425)
This commit is contained in:
parent
b8567f09cb
commit
43e795e791
|
@ -148,7 +148,7 @@ int Compiler::getLineNumberFromOutputLine(QString &line)
|
|||
pos = line.indexOf(',');
|
||||
}
|
||||
if (pos>=0) {
|
||||
result = line.midRef(0,pos).toInt();
|
||||
result = QStringView(line.data(), pos).toInt();
|
||||
if (result > 0)
|
||||
line.remove(0,pos+1);
|
||||
} else {
|
||||
|
@ -168,7 +168,7 @@ int Compiler::getColunmnFromOutputLine(QString &line)
|
|||
pos = line.indexOf(',');
|
||||
}
|
||||
if (pos>=0) {
|
||||
result = line.midRef(0,pos).toInt();
|
||||
result = QStringView(line.data(), pos).toInt();
|
||||
if (result > 0)
|
||||
line.remove(0,pos+1);
|
||||
}
|
||||
|
|
|
@ -3449,7 +3449,7 @@ void CppParser::handlePreprocessor()
|
|||
|
||||
// Mention progress to user if we enter a NEW file
|
||||
bool ok;
|
||||
int line = s.midRef(delimPos+1).toInt(&ok);
|
||||
int line = QStringView(s.begin() + delimPos + 1, s.end()).toInt(&ok);
|
||||
if (line == 1) {
|
||||
mFilesScannedCount++;
|
||||
mFilesToScanCount++;
|
||||
|
|
|
@ -1037,7 +1037,7 @@ QStringList CppPreprocessor::removeComments(const QStringList &text)
|
|||
currentType=ContentType::Other;
|
||||
break;
|
||||
case ContentType::RawString:
|
||||
if (line.midRef(0,pos).endsWith(')'+delimiter))
|
||||
if (QStringView(line.data(), pos).endsWith(')'+delimiter))
|
||||
currentType = ContentType::Other;
|
||||
break;
|
||||
case ContentType::Other:
|
||||
|
|
|
@ -194,7 +194,7 @@ QString CppTokenizer::getNextToken(TokenType *pTokenType)
|
|||
int delimPos = result.lastIndexOf(':');
|
||||
if (delimPos >= 0) {
|
||||
bool ok;
|
||||
mCurrentLine = result.midRef(delimPos+1).toInt(&ok)-1; // fCurrLine is 0 based
|
||||
mCurrentLine = QStringView(result.begin() + delimPos + 1, result.end()).toInt(&ok)-1; // fCurrLine is 0 based
|
||||
}
|
||||
}
|
||||
done = (result != "");
|
||||
|
|
|
@ -252,7 +252,7 @@ QString QConsole::selText()
|
|||
QString s = mContents.getLine(Last);
|
||||
if (Last == mContents.lines())
|
||||
s+= this->mCommand;
|
||||
result += s.leftRef(ColTo);
|
||||
result.append(s.data(), ColTo);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4497,7 +4497,8 @@ QString QSynEdit::selText() const
|
|||
result += mDocument->getLine(i);
|
||||
result+=lineBreak();
|
||||
}
|
||||
result += mDocument->getLine(lastLine).leftRef(charTo-1);
|
||||
const QString &line = mDocument->getLine(lastLine);
|
||||
result.append(line.data(), charTo-1);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue