Commit 14eadb0f authored by Friedemann Kleint's avatar Friedemann Kleint Committed by Christian Stenger

Fix accessing temporary copies via QStringRef

Amends change 840e7871

Change-Id: I633500b0fdbeeeb8b3d8accd3aec1e2990c62bca
Reviewed-by: Christian Stenger's avatarChristian Stenger <christian.stenger@qt.io>
parent 31749b76
......@@ -703,7 +703,9 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa
const int index = regExp.lastIndexIn(*selectedFilter);
if (index != -1) {
bool suffixOk = false;
const QVector<QStringRef> suffixes = regExp.cap(1).remove(QLatin1Char('*')).splitRef(QLatin1Char(' '));
QString caption = regExp.cap(1);
caption.remove(QLatin1Char('*'));
const QVector<QStringRef> suffixes = caption.splitRef(QLatin1Char(' '));
foreach (const QStringRef &suffix, suffixes)
if (fileName.endsWith(suffix)) {
suffixOk = true;
......
......@@ -2909,8 +2909,8 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
return;
}
const QString &verOutput = data.data();
const QVector<QStringRef> pythonVersion =
verOutput.split(QLatin1Char(' ')).constFirst().splitRef(QLatin1Char('.'));
const QString firstToken = verOutput.split(QLatin1Char(' ')).constFirst();
const QVector<QStringRef> pythonVersion =firstToken.splitRef(QLatin1Char('.'));
bool ok = false;
if (pythonVersion.size() == 3) {
......
......@@ -3515,7 +3515,7 @@ void GdbEngine::handleRegisterListing(const DebuggerResponse &response)
m_registers.clear();
QStringList lines = response.consoleStreamOutput.split('\n');
for (int i = 1; i < lines.size(); ++i) {
const QVector<QStringRef> parts = QString(lines.at(i)).splitRef(' ', QString::SkipEmptyParts);
const QVector<QStringRef> parts = lines.at(i).splitRef(' ', QString::SkipEmptyParts);
if (parts.size() < 7)
continue;
int gdbRegisterNumber = parts.at(1).toInt();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment