diff options
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmaketool.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/documentmanager.cpp | 6 | ||||
-rw-r--r-- | src/plugins/debugger/breakpoint.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/cdb/cdbengine.cpp | 5 | ||||
-rw-r--r-- | src/plugins/debugger/debuggerprotocol.cpp | 4 | ||||
-rw-r--r-- | src/plugins/debugger/gdb/gdbengine.cpp | 8 | ||||
-rw-r--r-- | src/plugins/debugger/watchhandler.cpp | 2 | ||||
-rw-r--r-- | src/plugins/projectexplorer/abi.cpp | 12 | ||||
-rw-r--r-- | src/plugins/texteditor/generichighlighter/highlighter.cpp | 4 | ||||
-rw-r--r-- | src/plugins/texteditor/linenumberfilter.cpp | 2 | ||||
-rw-r--r-- | src/plugins/valgrind/callgrind/callgrindparser.cpp | 2 |
11 files changed, 27 insertions, 24 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmaketool.cpp b/src/plugins/cmakeprojectmanager/cmaketool.cpp index 2cc0228656..e38ce68748 100644 --- a/src/plugins/cmakeprojectmanager/cmaketool.cpp +++ b/src/plugins/cmakeprojectmanager/cmaketool.cpp @@ -411,7 +411,7 @@ void CMakeTool::fetchVersionFromVersionOutput() const return; QRegularExpression versionLine("^cmake version ((\\d+).(\\d+).(\\d+).*)$"); - for (const QString &line : response.stdOut().split('\n')) { + for (const QStringRef &line : response.stdOut().splitRef(QLatin1Char('\n'))) { QRegularExpressionMatch match = versionLine.match(line); if (!match.hasMatch()) continue; diff --git a/src/plugins/coreplugin/documentmanager.cpp b/src/plugins/coreplugin/documentmanager.cpp index ef5ab7b776..9cf6a25a71 100644 --- a/src/plugins/coreplugin/documentmanager.cpp +++ b/src/plugins/coreplugin/documentmanager.cpp @@ -703,14 +703,14 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa const int index = regExp.lastIndexIn(*selectedFilter); if (index != -1) { bool suffixOk = false; - const QStringList &suffixes = regExp.cap(1).remove(QLatin1Char('*')).split(QLatin1Char(' ')); - foreach (const QString &suffix, suffixes) + const QVector<QStringRef> suffixes = regExp.cap(1).remove(QLatin1Char('*')).splitRef(QLatin1Char(' ')); + foreach (const QStringRef &suffix, suffixes) if (fileName.endsWith(suffix)) { suffixOk = true; break; } if (!suffixOk && !suffixes.isEmpty()) - fileName.append(suffixes.at(0)); + fileName.append(suffixes.at(0).toString()); } } if (QFile::exists(fileName)) { diff --git a/src/plugins/debugger/breakpoint.cpp b/src/plugins/debugger/breakpoint.cpp index 3313448fe4..448cbb7df5 100644 --- a/src/plugins/debugger/breakpoint.cpp +++ b/src/plugins/debugger/breakpoint.cpp @@ -228,8 +228,8 @@ bool BreakpointParameters::isCppBreakpoint() const if (qmlExtensionString.isEmpty()) qmlExtensionString = ".qml;.js"; - auto qmlFileExtensions = qmlExtensionString.split(";", QString::SkipEmptyParts); - foreach (QString extension, qmlFileExtensions) { + auto qmlFileExtensions = qmlExtensionString.splitRef(QLatin1Char(';'), QString::SkipEmptyParts); + foreach (QStringRef extension, qmlFileExtensions) { if (fileName.endsWith(extension, Qt::CaseInsensitive)) return false; } diff --git a/src/plugins/debugger/cdb/cdbengine.cpp b/src/plugins/debugger/cdb/cdbengine.cpp index 5afd9da1a1..e663e91fc8 100644 --- a/src/plugins/debugger/cdb/cdbengine.cpp +++ b/src/plugins/debugger/cdb/cdbengine.cpp @@ -2071,7 +2071,7 @@ void CdbEngine::ensureUsing32BitStackInWow64(const DebuggerResponse &response, c { // Parsing the header of the stack output to check which bitness // the cdb is currently using. - foreach (const QString &line, response.data.data().split('\n')) { + foreach (const QStringRef &line, response.data.data().splitRef(QLatin1Char('\n'))) { if (!line.startsWith("Child")) continue; if (line.startsWith("ChildEBP")) { @@ -2909,7 +2909,8 @@ void CdbEngine::setupScripting(const DebuggerResponse &response) return; } const QString &verOutput = data.data(); - const QStringList pythonVersion = verOutput.split(' ').first().split('.'); + const QVector<QStringRef> pythonVersion = + verOutput.split(QLatin1Char(' ')).constFirst().splitRef(QLatin1Char('.')); bool ok = false; if (pythonVersion.size() == 3) { diff --git a/src/plugins/debugger/debuggerprotocol.cpp b/src/plugins/debugger/debuggerprotocol.cpp index 46f60b0954..45288cb83c 100644 --- a/src/plugins/debugger/debuggerprotocol.cpp +++ b/src/plugins/debugger/debuggerprotocol.cpp @@ -822,9 +822,9 @@ QString DebuggerCommand::argsToString() const DebuggerEncoding::DebuggerEncoding(const QString &data) { - const QStringList l = data.split(':'); + const QVector<QStringRef> l = data.splitRef(QLatin1Char(':')); - const QString &t = l.at(0); + const QStringRef &t = l.at(0); if (t == "latin1") { type = HexEncodedLatin1; size = 1; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index 8a8e649522..7716240c5a 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -3515,14 +3515,14 @@ void GdbEngine::handleRegisterListing(const DebuggerResponse &response) m_registers.clear(); QStringList lines = response.consoleStreamOutput.split('\n'); for (int i = 1; i < lines.size(); ++i) { - QStringList parts = QString(lines.at(i)).split(' ', QString::SkipEmptyParts); + const QVector<QStringRef> parts = QString(lines.at(i)).splitRef(' ', QString::SkipEmptyParts); if (parts.size() < 7) continue; int gdbRegisterNumber = parts.at(1).toInt(); Register reg; - reg.name = parts.at(0); + reg.name = parts.at(0).toString(); reg.size = parts.at(4).toInt(); - reg.reportedType = parts.at(5); + reg.reportedType = parts.at(5).toString(); m_registers[gdbRegisterNumber] = reg; } } @@ -3895,7 +3895,7 @@ static SourcePathMap mergeStartParametersSourcePathMap(const DebuggerRunParamete void GdbEngine::startGdb(const QStringList &args) { const QString tests = QString::fromLocal8Bit(qgetenv("QTC_DEBUGGER_TESTS")); - foreach (const QString &test, tests.split(',')) + foreach (const QStringRef &test, tests.splitRef(QLatin1Char(','))) m_testCases.insert(test.toInt()); foreach (int test, m_testCases) showMessage("ENABLING TEST CASE: " + QString::number(test)); diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index afd40dfdcc..e295492d05 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -2531,7 +2531,7 @@ void WatchHandler::addDumpers(const GdbMi &dumpers) DisplayFormats formats; formats.append(RawFormat); QString reportedFormats = dumper["formats"].data(); - foreach (const QString &format, reportedFormats.split(',')) { + foreach (const QStringRef &format, reportedFormats.splitRef(',')) { if (int f = format.toInt()) formats.append(DisplayFormat(f)); } diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp index 9b42b97f6b..448f8cfe3f 100644 --- a/src/plugins/projectexplorer/abi.cpp +++ b/src/plugins/projectexplorer/abi.cpp @@ -352,7 +352,7 @@ Abi::Abi(const QString &abiString) : m_architecture(UnknownArchitecture), m_os(UnknownOS), m_osFlavor(UnknownFlavor), m_binaryFormat(UnknownFormat), m_wordWidth(0) { - QStringList abiParts = abiString.split(QLatin1Char('-')); + const QVector<QStringRef> abiParts = abiString.splitRef(QLatin1Char('-')); if (abiParts.count() >= 1) { if (abiParts.at(0) == QLatin1String("unknown")) m_architecture = UnknownArchitecture; @@ -453,12 +453,14 @@ Abi::Abi(const QString &abiString) : } if (abiParts.count() >= 5) { - const QString &bits = abiParts.at(4); + const QStringRef &bits = abiParts.at(4); if (!bits.endsWith(QLatin1String("bit"))) return; bool ok = false; - int bitCount = bits.leftRef(bits.count() - 3).toInt(&ok); + const QStringRef number = + bits.string()->midRef(bits.position(), bits.count() - 3); + const int bitCount = number.toInt(&ok); if (!ok) return; if (bitCount != 8 && bitCount != 16 && bitCount != 32 && bitCount != 64) @@ -473,7 +475,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) if (machine.isEmpty()) return Abi(); - QStringList parts = machine.split(QRegExp(QLatin1String("[ /-]"))); + const QVector<QStringRef> parts = machine.splitRef(QRegExp(QLatin1String("[ /-]"))); Abi::Architecture arch = Abi::UnknownArchitecture; Abi::OS os = Abi::UnknownOS; @@ -482,7 +484,7 @@ Abi Abi::abiFromTargetTriplet(const QString &triple) unsigned char width = 0; int unknownCount = 0; - foreach (const QString &p, parts) { + for (const QStringRef &p : parts) { if (p == QLatin1String("unknown") || p == QLatin1String("pc") || p == QLatin1String("none") || p == QLatin1String("gnu") || p == QLatin1String("uclibc") || p == QLatin1String("86_64") || p == QLatin1String("redhat") diff --git a/src/plugins/texteditor/generichighlighter/highlighter.cpp b/src/plugins/texteditor/generichighlighter/highlighter.cpp index 877767f4c4..89150ac6d4 100644 --- a/src/plugins/texteditor/generichighlighter/highlighter.cpp +++ b/src/plugins/texteditor/generichighlighter/highlighter.cpp @@ -415,8 +415,8 @@ void Highlighter::changeContext(const QString &contextName, const bool assignCurrent) { if (contextName.startsWith(kPop)) { - QStringList list = contextName.split(kHash, QString::SkipEmptyParts); - for (int i = 0; i < list.size(); ++i) { + const int count = contextName.splitRef(kHash, QString::SkipEmptyParts).size(); + for (int i = 0; i < count; ++i) { if (m_contexts.isEmpty()) { throw HighlighterException( QCoreApplication::translate("GenericHighlighter", "Reached empty context.")); diff --git a/src/plugins/texteditor/linenumberfilter.cpp b/src/plugins/texteditor/linenumberfilter.cpp index f2315d4e11..1376972733 100644 --- a/src/plugins/texteditor/linenumberfilter.cpp +++ b/src/plugins/texteditor/linenumberfilter.cpp @@ -61,7 +61,7 @@ void LineNumberFilter::prepareSearch(const QString &entry) QList<LocatorFilterEntry> LineNumberFilter::matchesFor(QFutureInterface<LocatorFilterEntry> &, const QString &entry) { QList<LocatorFilterEntry> value; - QStringList lineAndColumn = entry.split(QLatin1Char(':')); + const QVector<QStringRef> lineAndColumn = entry.splitRef(QLatin1Char(':')); int sectionCount = lineAndColumn.size(); int line = 0; int column = 0; diff --git a/src/plugins/valgrind/callgrind/callgrindparser.cpp b/src/plugins/valgrind/callgrind/callgrindparser.cpp index 9b072ee1b4..fec9f52c5c 100644 --- a/src/plugins/valgrind/callgrind/callgrindparser.cpp +++ b/src/plugins/valgrind/callgrind/callgrindparser.cpp @@ -327,7 +327,7 @@ void Parser::Private::parseHeader(QIODevice *device) } else if (line.startsWith("summary: ")) { QString values = getValue(line, 9); uint i = 0; - foreach (const QString &value, values.split(QLatin1Char(' '), QString::SkipEmptyParts)) + foreach (const QStringRef &value, values.splitRef(QLatin1Char(' '), QString::SkipEmptyParts)) data->setTotalCost(i++, value.toULongLong()); } else if (!line.trimmed().isEmpty()) { // handle line and exit parseHeader |