diff --git a/src/mode/katemodemenulist.cpp b/src/mode/katemodemenulist.cpp --- a/src/mode/katemodemenulist.cpp +++ b/src/mode/katemodemenulist.cpp @@ -504,7 +504,7 @@ for (const auto &ext : m_type->wildcards) { // File extension if (ext.startsWith(QLatin1String("*."))) { - if (text.length() == ext.length() - 2 && text.compare(ext.mid(2), Qt::CaseInsensitive) == 0) { + if (text.length() == ext.length() - 2 && text.compare(ext.midRef(2), Qt::CaseInsensitive) == 0) { return true; } } else if (text.length() != ext.length() || ext.endsWith(QLatin1Char('*'))) { diff --git a/src/utils/katesedcmd.cpp b/src/utils/katesedcmd.cpp --- a/src/utils/katesedcmd.cpp +++ b/src/utils/katesedcmd.cpp @@ -47,7 +47,7 @@ } else { // isn't a slash if (!evenCount) { - if (haystack.mid(index, searchlen) == needle) { + if (haystack.midRef(index, searchlen) == needle) { return index - 1; } } @@ -95,7 +95,7 @@ return false; } - const QString searchParamsString = cmd.mid(cmd.lastIndexOf(delimiter)); + const QStringRef searchParamsString = cmd.midRef(cmd.lastIndexOf(delimiter)); const bool noCase = searchParamsString.contains(QLatin1Char('i')); const bool repeat = searchParamsString.contains(QLatin1Char('g')); const bool interactive = searchParamsString.contains(QLatin1Char('c')); diff --git a/src/vimode/config/configtab.cpp b/src/vimode/config/configtab.cpp --- a/src/vimode/config/configtab.cpp +++ b/src/vimode/config/configtab.cpp @@ -236,7 +236,7 @@ } else if (line.size() == 4 && line[0] == QLatin1String("let") && line[2] == QLatin1String("=") && mapleader.match(line[1]).hasMatch()) { - const QString &leader = line[3].mid(1, line[3].length() - 2); + const QStringRef leader = line[3].midRef(1, line[3].length() - 2); if (!leader.isEmpty()) { m_mappings->setLeader(leader[0]); } diff --git a/src/vimode/emulatedcommandbar/commandmode.cpp b/src/vimode/emulatedcommandbar/commandmode.cpp --- a/src/vimode/emulatedcommandbar/commandmode.cpp +++ b/src/vimode/emulatedcommandbar/commandmode.cpp @@ -310,9 +310,9 @@ const QString command = m_edit->text(); ParsedSedExpression parsedSedExpression = parseAsSedExpression(); Q_ASSERT(parsedSedExpression.parsedSuccessfully); - return command.mid(0, parsedSedExpression.findBeginPos) + + return command.midRef(0, parsedSedExpression.findBeginPos) + newFindTerm + - command.mid(parsedSedExpression.findEndPos + 1); + command.midRef(parsedSedExpression.findEndPos + 1); } QString CommandMode::withSedDelimiterEscaped ( const QString& text ) diff --git a/src/vimode/keyparser.cpp b/src/vimode/keyparser.cpp --- a/src/vimode/keyparser.cpp +++ b/src/vimode/keyparser.cpp @@ -601,7 +601,7 @@ if (c == QLatin1Char('<')) { // If there's no closing '>', or if there is an opening '<' before the next '>', interpret as a literal '<' // If we are , encode as a literal " ". - QString rest = keys.mid(i); + const QStringRef rest = keys.midRef(i); if (rest.indexOf(QLatin1Char('>'), 1) != -1 && rest.mid(1, rest.indexOf(QLatin1Char('>'), 1) - 1) == QLatin1String("space")) { encodedSequence.append(QLatin1Char(' ')); i += rest.indexOf(QLatin1Char('>'), 1); diff --git a/src/vimode/modes/modebase.cpp b/src/vimode/modes/modebase.cpp --- a/src/vimode/modes/modebase.cpp +++ b/src/vimode/modes/modebase.cpp @@ -1211,7 +1211,7 @@ } else if (base == 8) { basePrefix = QStringLiteral("0"); } - const QString withoutBase = numberAsString.mid(basePrefix.length()); + const QStringRef withoutBase = numberAsString.midRef(basePrefix.length()); const int newNumber = originalNumber + count;