diff --git a/src/completion/katecompletionmodel.cpp b/src/completion/katecompletionmodel.cpp --- a/src/completion/katecompletionmodel.cpp +++ b/src/completion/katecompletionmodel.cpp @@ -752,7 +752,7 @@ if (groupingMethod() & Scope) { if (!title.isEmpty()) { - title.append(QLatin1String(" ")); + title.append(QLatin1Char(' ')); } title.append(scope); @@ -803,7 +803,7 @@ if (!it.isEmpty()) { if (!title.isEmpty()) { - title.append(QLatin1String(" ")); + title.append(QLatin1Char(' ')); } title.append(it); @@ -1350,7 +1350,7 @@ foreach (const QList& list, m_columnMerges) { columnMerge += '['; foreach (int column, list) { - columnMerge += QString::number(column) + " "; + columnMerge += QString::number(column) + QLatin1Char(' '); } columnMerge += "] "; } diff --git a/src/document/katedocument.cpp b/src/document/katedocument.cpp --- a/src/document/katedocument.cpp +++ b/src/document/katedocument.cpp @@ -811,7 +811,7 @@ } // just reuse normal function - return insertText(position, textLines.join(QLatin1String("\n")), block); + return insertText(position, textLines.join(QLatin1Char('\n')), block); } bool KTextEditor::DocumentPrivate::removeText(const KTextEditor::Range &_range, bool block) @@ -1721,7 +1721,7 @@ // remember last change cursor m_editLastChangeStartCursor = rangeRemoved.start(); - emit textRemoved(this, rangeRemoved, oldText.join(QLatin1String("\n")) + QLatin1Char('\n')); + emit textRemoved(this, rangeRemoved, oldText.join(QLatin1Char('\n')) + QLatin1Char('\n')); editEnd(); diff --git a/src/inputmode/kateviinputmode.cpp b/src/inputmode/kateviinputmode.cpp --- a/src/inputmode/kateviinputmode.cpp +++ b/src/inputmode/kateviinputmode.cpp @@ -170,7 +170,7 @@ QString currentMode = viModeToString(m_viModeManager->getCurrentViMode()); if (m_viModeManager->macroRecorder()->isRecording()) { - currentMode.prepend(QLatin1String("(") + i18n("recording") + QLatin1String(") ")); + currentMode.prepend(QLatin1Char('(') + i18n("recording") + QLatin1String(") ")); } QString cmd = m_viModeManager->getVerbatimKeys(); diff --git a/src/mode/katemodeconfigpage.cpp b/src/mode/katemodeconfigpage.cpp --- a/src/mode/katemodeconfigpage.cpp +++ b/src/mode/katemodeconfigpage.cpp @@ -60,7 +60,7 @@ ui->cmbHl->addItem(i18n(""), QVariant(QString())); for (const auto &hl : KateHlManager::self()->modeList()) { if (hl.section().length() > 0) - ui->cmbHl->addItem(hl.section() + QLatin1String("/") + hl.translatedName(), QVariant(hl.name())); + ui->cmbHl->addItem(hl.section() + QLatin1Char('/') + hl.translatedName(), QVariant(hl.name())); else { ui->cmbHl->addItem(hl.translatedName(), QVariant(hl.name())); } @@ -145,7 +145,7 @@ foreach (KateFileType *type, m_types) { if (!type->sectionTranslated().isEmpty()) { - ui->cmbFiletypes->addItem(type->sectionTranslated() + QLatin1String("/") + type->nameTranslated()); + ui->cmbFiletypes->addItem(type->sectionTranslated() + QLatin1Char('/') + type->nameTranslated()); } else { ui->cmbFiletypes->addItem(type->nameTranslated()); } diff --git a/src/schema/kateschemaconfig.cpp b/src/schema/kateschemaconfig.cpp --- a/src/schema/kateschemaconfig.cpp +++ b/src/schema/kateschemaconfig.cpp @@ -633,7 +633,7 @@ for (const auto &hl : KateHlManager::self()->modeList()) { if (hl.section().length() > 0) { - hlCombo->addItem(hl.section() + QLatin1String("/") + hl.translatedName()); + hlCombo->addItem(hl.section() + QLatin1Char('/') + hl.translatedName()); } else { hlCombo->addItem(hl.translatedName()); } diff --git a/src/search/kateplaintextsearch.cpp b/src/search/kateplaintextsearch.cpp --- a/src/search/kateplaintextsearch.cpp +++ b/src/search/kateplaintextsearch.cpp @@ -65,7 +65,7 @@ } // split multi-line needle into single lines - const QStringList needleLines = text.split(QStringLiteral("\n")); + const QStringList needleLines = text.split(QLatin1Char('\n')); if (needleLines.count() > 1) { // multi-line plaintext search (both forwards or backwards) diff --git a/src/search/kateregexpsearch.cpp b/src/search/kateregexpsearch.cpp --- a/src/search/kateregexpsearch.cpp +++ b/src/search/kateregexpsearch.cpp @@ -247,7 +247,6 @@ FAST_DEBUG(" line" << 0 << "has length" << lineLens[0]); // second line and after - const QString sep = QStringLiteral("\n"); for (int i = 1; i < inputLineCount; i++) { const int lineNum = firstLineIndex + i; if (lineNum < 0 || m_document->lines() <= lineNum) { @@ -258,7 +257,7 @@ const QString text = m_document->line(lineNum); lineLens[i] = text.length(); - wholeDocument.append(sep); + wholeDocument.append(QLatin1Char('\n')); wholeDocument.append(text); FAST_DEBUG(" line" << i << "has length" << lineLens[i]); } diff --git a/src/search/katesearchbar.cpp b/src/search/katesearchbar.cpp --- a/src/search/katesearchbar.cpp +++ b/src/search/katesearchbar.cpp @@ -1219,7 +1219,7 @@ for (int i = 1; i <= 9; i++) { const QString number = QString::number(i); const QString &captureDetails = (i <= captureCount) - ? (QString::fromLatin1(" = (") + capturePatterns[i - 1].left(30)) + QLatin1String(")") + ? (QString::fromLatin1(" = (") + capturePatterns[i - 1].left(30)) + QLatin1Char(')') : QString(); addMenuManager.addEntry(QLatin1String("\\") + number, QString(), i18n("Reference") + QLatin1Char(' ') + number + captureDetails); diff --git a/src/swapfile/kateswapfile.cpp b/src/swapfile/kateswapfile.cpp --- a/src/swapfile/kateswapfile.cpp +++ b/src/swapfile/kateswapfile.cpp @@ -596,14 +596,14 @@ // append the sha1 sum of the full path + filename, to avoid "too long" paths created path.append(QString::fromLatin1(QCryptographicHash::hash(fullLocalPath.toUtf8(), QCryptographicHash::Sha1).toHex())); - path.append(QLatin1String("-")); + path.append(QLatin1Char('-')); path.append(QFileInfo(fullLocalPath).fileName()); path.append(QLatin1String(".kate-swp")); } else { path = fullLocalPath; int poz = path.lastIndexOf(QLatin1Char('/')); - path.insert(poz + 1, QLatin1String(".")); + path.insert(poz + 1, QLatin1Char('.')); path.append(QLatin1String(".kate-swp")); } diff --git a/src/utils/katecommandrangeexpressionparser.cpp b/src/utils/katecommandrangeexpressionparser.cpp --- a/src/utils/katecommandrangeexpressionparser.cpp +++ b/src/utils/katecommandrangeexpressionparser.cpp @@ -46,12 +46,12 @@ m_thisLine.pattern() + QLatin1String(")|(?:") + m_lastLine.pattern() + QLatin1String(")|(?:") + m_forwardSearch2.pattern() + QLatin1String(")|(?:") + - m_backwardSearch2.pattern() + QLatin1String(")")); + m_backwardSearch2.pattern() + QLatin1Char(')')); m_offset.setPattern(QLatin1String("[+-](?:") + m_base.pattern() + QLatin1String(")?")); // The position regexp contains two groups: the base and the offset. // The offset may be empty. - m_position.setPattern(QLatin1String("(") + m_base.pattern() + QLatin1String(")((?:") + m_offset.pattern() + QLatin1String(")*)")); + m_position.setPattern(QLatin1Char('(') + m_base.pattern() + QLatin1String(")((?:") + m_offset.pattern() + QLatin1String(")*)")); // The range regexp contains seven groups: the first is the start position, the second is // the base of the start position, the third is the offset of the start position, the diff --git a/src/variableeditor/variablelistview.cpp b/src/variableeditor/variablelistview.cpp --- a/src/variableeditor/variablelistview.cpp +++ b/src/variableeditor/variablelistview.cpp @@ -129,7 +129,7 @@ QMap::const_iterator it = m_variables.constBegin(); while (it != m_variables.constEnd()) { if (!line.isEmpty()) { - line += QLatin1String(" "); + line += QLatin1Char(' '); } line += it.key() + QLatin1Char(' ') + it.value() + QLatin1Char(';'); diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp --- a/src/view/kateviewhelpers.cpp +++ b/src/view/kateviewhelpers.cpp @@ -3080,7 +3080,7 @@ * get text for the menu ;) */ QString leftPart = (text.size() > 48) ? (text.left(48) + QLatin1String("...")) : text; - QAction *a = menu()->addAction(leftPart.replace(QLatin1String("\n"), QLatin1String(" ")), this, SLOT(paste())); + QAction *a = menu()->addAction(leftPart.replace(QLatin1Char('\n'), QLatin1Char(' ')), this, SLOT(paste())); a->setData(i++); } } diff --git a/src/vimode/appcommands.cpp b/src/vimode/appcommands.cpp --- a/src/vimode/appcommands.cpp +++ b/src/vimode/appcommands.cpp @@ -158,7 +158,7 @@ if (base.isValid()) { // first try to use the same path as the current open document has url = QUrl(base.resolved(arg2path)); //resolved handles the case where the args is a relative path, and is the same as using QUrl(args) elsewise } else { // else use the cwd - url = QUrl(QUrl(QDir::currentPath() + QLatin1String("/")).resolved(arg2path)); // + "/" is needed because of http://lists.qt.nokia.com/public/qt-interest/2011-May/033913.html + url = QUrl(QUrl(QDir::currentPath() + QLatin1Char('/')).resolved(arg2path)); // + "/" is needed because of http://lists.qt.nokia.com/public/qt-interest/2011-May/033913.html } QFileInfo file(url.toLocalFile()); diff --git a/src/vimode/inputmodemanager.cpp b/src/vimode/inputmodemanager.cpp --- a/src/vimode/inputmodemanager.cpp +++ b/src/vimode/inputmodemanager.cpp @@ -172,7 +172,7 @@ // remove the angle brackets decoded.remove(0, 1); - decoded.remove(decoded.indexOf(QLatin1String(">")), 1); + decoded.remove(decoded.indexOf(QLatin1Char('>')), 1); // check if one or more modifier keys where used if (decoded.indexOf(QLatin1String("s-")) != -1 || decoded.indexOf(QLatin1String("c-")) != -1 diff --git a/src/vimode/keyparser.cpp b/src/vimode/keyparser.cpp --- a/src/vimode/keyparser.cpp +++ b/src/vimode/keyparser.cpp @@ -603,7 +603,7 @@ // If we are , encode as a literal " ". QString rest = keys.mid(i); if (rest.indexOf(QLatin1Char('>'), 1) != -1 && rest.mid(1, rest.indexOf(QLatin1Char('>'), 1) - 1) == QLatin1String("space")) { - encodedSequence.append(QLatin1String(" ")); + encodedSequence.append(QLatin1Char(' ')); i += rest.indexOf(QLatin1Char('>'), 1); continue; } else if (rest.indexOf(QLatin1Char('>'), 1) == -1 || (rest.indexOf(QLatin1Char('<'), 1) < rest.indexOf(QLatin1Char('>'), 1) && rest.indexOf(QLatin1Char('<'), 1) != -1)) { diff --git a/src/vimode/macros.cpp b/src/vimode/macros.cpp --- a/src/vimode/macros.cpp +++ b/src/vimode/macros.cpp @@ -122,7 +122,7 @@ QString Macros::encodeMacroCompletionForConfig(const Completion &completionForMacro) const { const bool endedWithSemiColon = completionForMacro.completedText().endsWith(QLatin1Char(';')); - QString encodedMacroCompletion = completionForMacro.completedText().remove(QStringLiteral("()")).remove(QStringLiteral(";")); + QString encodedMacroCompletion = completionForMacro.completedText().remove(QStringLiteral("()")).remove(QLatin1Char(';')); if (completionForMacro.completionType() == Completion::FunctionWithArgs) { encodedMacroCompletion += QLatin1String("(...)"); } else if (completionForMacro.completionType() == Completion::FunctionWithoutArgs) { @@ -139,7 +139,7 @@ Completion Macros::decodeMacroCompletionFromConfig(const QString &encodedMacroCompletion) { - const bool removeTail = encodedMacroCompletion.endsWith(QLatin1String("|")); + const bool removeTail = encodedMacroCompletion.endsWith(QLatin1Char('|')); Completion::CompletionType completionType = Completion::PlainText; if (encodedMacroCompletion.contains(QLatin1String("(...)"))) { completionType = Completion::FunctionWithArgs; diff --git a/src/vimode/marks.cpp b/src/vimode/marks.cpp --- a/src/vimode/marks.cpp +++ b/src/vimode/marks.cpp @@ -236,7 +236,7 @@ Q_FOREACH (QChar markerChar, m_marks.keys()) { if (m_marks.value(markerChar)->line() == line) { - res += markerChar + QLatin1String(":") + QString::number(m_marks.value(markerChar)->column()) + QLatin1String(" "); + res += markerChar + QLatin1Char(':') + QString::number(m_marks.value(markerChar)->column()) + QLatin1Char(' '); } } diff --git a/src/vimode/modes/normalvimode.cpp b/src/vimode/modes/normalvimode.cpp --- a/src/vimode/modes/normalvimode.cpp +++ b/src/vimode/modes/normalvimode.cpp @@ -2631,7 +2631,7 @@ int column = n2 - item.length(); bool reverse = false; - if (matchingItem.left(1) == QLatin1String("-")) { + if (matchingItem.startsWith(QLatin1Char('-'))) { matchingItem.remove(0, 1); // remove the '-' reverse = true; }