Commit a63b806b authored by Kevin Funk's avatar Kevin Funk

Clazy fixit: fix-qlatin1string-allocations

parent afa85f42
......@@ -57,8 +57,8 @@ QString verboseMessageToHtml( const QString & input )
output.replace(QLatin1String("\\012"), QLatin1String("\n"));
if (output.count('\n') >= 2) {
output.replace(output.indexOf('\n'), 1, QLatin1String("<pre>") );
output.replace(output.lastIndexOf('\n'), 1, QLatin1String("</pre><br>") );
output.replace(output.indexOf('\n'), 1, QStringLiteral("<pre>") );
output.replace(output.lastIndexOf('\n'), 1, QStringLiteral("</pre><br>") );
}
return output;
......@@ -117,7 +117,7 @@ bool CppcheckParser::startElement()
else if (name() == "error") {
newState = Error;
m_errorSeverity = QLatin1String("unknown");
m_errorSeverity = QStringLiteral("unknown");
m_errorInconclusive = false;
m_errorFiles.clear();
m_errorLines.clear();
......
This diff is collapsed.
......@@ -328,7 +328,7 @@ void MIBreakpointController::createBreakpoint(int row)
}
if (location == QLatin1String("catch throw")) {
location = QLatin1String("exception throw");
location = QStringLiteral("exception throw");
}
// Note: We rely on '-f' to be automatically added by the MICommand logic
......@@ -352,9 +352,9 @@ void MIBreakpointController::createBreakpoint(int row)
} else {
QString opt;
if (modelBreakpoint->kind() == Breakpoint::ReadBreakpoint)
opt = QLatin1String("-r ");
opt = QStringLiteral("-r ");
else if (modelBreakpoint->kind() == Breakpoint::AccessBreakpoint)
opt = QLatin1String("-a ");
opt = QStringLiteral("-a ");
debugSession()->addCommand(BreakWatch,
opt + Utils::quoteExpression(modelBreakpoint->location()),
......
......@@ -887,7 +887,7 @@ void MIDebugSession::executeCmd()
} else {
if (commandText[length-1] != '\n') {
bad_command = true;
message = QLatin1String("Debugger command does not end with newline");
message = QStringLiteral("Debugger command does not end with newline");
}
}
......
......@@ -130,7 +130,7 @@ void ModelsManager::updateModelForGroup(const RegistersGroup& group)
QString prefix;
if (currentFormat == Binary && ((currentMode < v4_float || currentMode > v2_double) &&
(currentMode < f32 || currentMode > f64) && group.groupName.type() != floatPoint)) {
prefix = QLatin1String("0b");
prefix = QStringLiteral("0b");
}
for (int column = 0; column < values.count(); column ++) {
......
......@@ -62,22 +62,22 @@ void IRegisterController::updateRegisters(const GroupsName& group)
Format currentFormat = formats(group).first();
switch (currentFormat) {
case Binary:
registers = QLatin1String("t ");
registers = QStringLiteral("t ");
break;
case Octal:
registers = QLatin1String("o ");
registers = QStringLiteral("o ");
break;
case Decimal :
registers = QLatin1String("d ");
registers = QStringLiteral("d ");
break;
case Hexadecimal:
registers = QLatin1String("x ");
registers = QStringLiteral("x ");
break;
case Raw:
registers = QLatin1String("r ");
registers = QStringLiteral("r ");
break;
case Unsigned:
registers = QLatin1String("u ");
registers = QStringLiteral("u ");
break;
default:
break;
......@@ -87,7 +87,7 @@ void IRegisterController::updateRegisters(const GroupsName& group)
Mode currentMode = modes(group).first();
if (((currentMode >= v4_float && currentMode <= v2_double) ||
(currentMode >= f32 && currentMode <= f64) || group.type() == floatPoint) && currentFormat != Raw) {
registers = QLatin1String("N ");
registers = QStringLiteral("N ");
}
if (group.type() == flag) {
......
......@@ -151,7 +151,7 @@ void RegisterController_Arm::initRegisterNames()
m_registerNames[VFP_single] << ("s" + QString::number(i));
}
m_cpsr.registerName = QLatin1String("cpsr");
m_cpsr.registerName = QStringLiteral("cpsr");
m_cpsr.flags << QStringLiteral("Q") << QStringLiteral("V") << QStringLiteral("C") << QStringLiteral("Z") << QStringLiteral("N");
m_cpsr.bits << QStringLiteral("27") << QStringLiteral("28") << QStringLiteral("29") << QStringLiteral("30") << QStringLiteral("31");
m_cpsr.groupName = enumToGroupName(Flags);
......
......@@ -179,7 +179,7 @@ void RegisterControllerGeneral_x86::initRegisterNames()
m_eflags.flags = m_registerNames[Flags];
m_eflags.bits << QStringLiteral("0") << QStringLiteral("2") << QStringLiteral("4") << QStringLiteral("6") << QStringLiteral("7") << QStringLiteral("8") << QStringLiteral("10") << QStringLiteral("11");
m_eflags.registerName = QLatin1String("eflags");
m_eflags.registerName = QStringLiteral("eflags");
m_eflags.groupName = enumToGroupName(Flags);
}
......
......@@ -3,8 +3,8 @@
int main()
{
QMap<QString, QString> m;
m[QStringLiteral("10")] = QLatin1String("100");
m[QStringLiteral("20")] = QLatin1String("200");
m[QStringLiteral("30")] = QLatin1String("300");
m[QStringLiteral("10")] = QStringLiteral("100");
m[QStringLiteral("20")] = QStringLiteral("200");
m[QStringLiteral("30")] = QStringLiteral("300");
return 0;
}
......@@ -316,8 +316,8 @@ void GdbTest::testEnvironmentSet()
WritableEnvironmentProfileList envProfiles(cfg.rootConfig());
envProfiles.removeProfile(QStringLiteral("GdbTestGroup"));
auto &envs = envProfiles.variables(QStringLiteral("GdbTestGroup"));
envs[QStringLiteral("VariableA")] = QLatin1String("-A' \" complex --value");
envs[QStringLiteral("VariableB")] = QLatin1String("-B' \" complex --value");
envs[QStringLiteral("VariableA")] = QStringLiteral("-A' \" complex --value");
envs[QStringLiteral("VariableB")] = QStringLiteral("-B' \" complex --value");
envProfiles.saveSettings(cfg.rootConfig());
QSignalSpy outputSpy(session, &TestDebugSession::inferiorStdoutLines);
......@@ -1854,7 +1854,7 @@ void GdbTest::testThreadAndFrameInfo()
QSignalSpy outputSpy(session, &TestDebugSession::debuggerUserCommandOutput);
session->addCommand(new MI::UserCommand(MI::ThreadInfo,QLatin1String("")));
session->addCommand(new MI::UserCommand(MI::StackListLocals, QLatin1String("0")));
session->addCommand(new MI::UserCommand(MI::StackListLocals, QStringLiteral("0")));
WAIT_FOR_STATE_AND_IDLE(session, DebugSession::PausedState); // wait for command finish
// outputs should be
......
......@@ -53,105 +53,105 @@ QString LldbCommand::miCommand() const
command = QLatin1String("");
break;
case BreakInsert: // in lldb-mi, '-f' must be the last option switch right before location
command = QLatin1String("break-insert");
command = QStringLiteral("break-insert");
isMI = true;
break;
case BreakList:
command = QLatin1String("");
break;
case BreakWatch:
command = QLatin1String("break set var");
command = QStringLiteral("break set var");
break;
case DataListChangedRegisters:
command = QLatin1String("data-list-changed-registers");
command = QStringLiteral("data-list-changed-registers");
break;
case DataReadMemory: // not implemented, deprecated
command = QLatin1String("data-read-memory");
command = QStringLiteral("data-read-memory");
break;
case DataWriteRegisterVariables:
command = QLatin1String("data-write-register-values");
command = QStringLiteral("data-write-register-values");
break;
case EnableTimings:
command = QLatin1String("enable-timings");
command = QStringLiteral("enable-timings");
break;
case EnvironmentDirectory:
command = QLatin1String("environment-directory");
command = QStringLiteral("environment-directory");
break;
case EnvironmentPath:
command = QLatin1String("environment-path");
command = QStringLiteral("environment-path");
break;
case EnvironmentPwd:
command = QLatin1String("environment-pwd");
command = QStringLiteral("environment-pwd");
break;
case ExecUntil:
// TODO: write test case for this
command = QLatin1String("thread until");
command = QStringLiteral("thread until");
break;
case FileExecFile:
command = QLatin1String("file-exec-file");//"exec-file"
command = QStringLiteral("file-exec-file");//"exec-file"
break;
case FileListExecSourceFile:
command = QLatin1String("file-list-exec-source-file");
command = QStringLiteral("file-list-exec-source-file");
break;
case FileListExecSourceFiles:
command = QLatin1String("file-list-exec-source-files");
command = QStringLiteral("file-list-exec-source-files");
break;
case FileSymbolFile:
command = QLatin1String("file-symbol-file");//"symbol-file"
command = QStringLiteral("file-symbol-file");//"symbol-file"
break;
case GdbVersion:
command = QLatin1String("gdb-version");//"show version"
command = QStringLiteral("gdb-version");//"show version"
break;
case InferiorTtyShow:
command = QLatin1String("inferior-tty-show");
command = QStringLiteral("inferior-tty-show");
break;
case SignalHandle:
command = QLatin1String("process handle");
command = QStringLiteral("process handle");
break;
case TargetDisconnect:
command = QLatin1String("target-disconnect");//"disconnect"
command = QStringLiteral("target-disconnect");//"disconnect"
break;
case TargetDownload:
command = QLatin1String("target-download");
command = QStringLiteral("target-download");
break;
case ThreadListIds:
command = QLatin1String("thread-list-ids");
command = QStringLiteral("thread-list-ids");
break;
case ThreadSelect:
command = QLatin1String("thread-select");
command = QStringLiteral("thread-select");
break;
case TraceFind:
command = QLatin1String("trace-find");
command = QStringLiteral("trace-find");
break;
case TraceStart:
command = QLatin1String("trace-start");
command = QStringLiteral("trace-start");
break;
case TraceStop:
command = QLatin1String("trace-stop");
command = QStringLiteral("trace-stop");
break;
case VarInfoNumChildren:
command = QLatin1String("var-info-num-children");
command = QStringLiteral("var-info-num-children");
break;
case VarInfoType:
command = QLatin1String("var-info-type");
command = QStringLiteral("var-info-type");
break;
case VarSetFrozen:
command = QLatin1String("var-set-frozen");
command = QStringLiteral("var-set-frozen");
break;
case VarShowFormat:
command = QLatin1String("var-show-format");
command = QStringLiteral("var-show-format");
break;
default:
return MICommand::miCommand();
......@@ -172,10 +172,10 @@ QString LldbCommand::cmdToSend()
QString disassembly_flavor = QStringLiteral("disassembly-flavor ");
if (command_.startsWith(env_name)) {
command_ = command_.mid(env_name.length());
overrideCmd = QLatin1String("settings set target.env-vars");
overrideCmd = QStringLiteral("settings set target.env-vars");
} else if (command_.startsWith(disassembly_flavor)) {
command_ = command_.mid(disassembly_flavor.length());
overrideCmd = QLatin1String("settings set target.x86-disassembly-flavor");
overrideCmd = QStringLiteral("settings set target.x86-disassembly-flavor");
}
break;
}
......
......@@ -3,8 +3,8 @@
int main()
{
QMap<QString, QString> m;
m[QStringLiteral("10")] = QLatin1String("100");
m[QStringLiteral("20")] = QLatin1String("200");
m[QStringLiteral("30")] = QLatin1String("300");
m[QStringLiteral("10")] = QStringLiteral("100");
m[QStringLiteral("20")] = QStringLiteral("200");
m[QStringLiteral("30")] = QStringLiteral("300");
return 0;
}
......@@ -265,8 +265,8 @@ void LldbTest::testEnvironmentSet()
WritableEnvironmentProfileList envProfiles(cfg.rootConfig());
envProfiles.removeProfile(QStringLiteral("LldbTestGroup"));
auto &envs = envProfiles.variables(QStringLiteral("LldbTestGroup"));
envs[QStringLiteral("VariableA")] = QLatin1String("-A' \" complex --value");
envs[QStringLiteral("VariableB")] = QLatin1String("-B' \" complex --value");
envs[QStringLiteral("VariableA")] = QStringLiteral("-A' \" complex --value");
envs[QStringLiteral("VariableB")] = QStringLiteral("-B' \" complex --value");
envProfiles.saveSettings(cfg.rootConfig());
QSignalSpy outputSpy(session, &TestDebugSession::inferiorStdoutLines);
......
......@@ -191,12 +191,12 @@ QString QtHelpDocumentation::description() const
{
const QString sizeRegExp = QStringLiteral("< h\\d ").replace(' ', optionalSpace);
const QRegularExpression findSize(sizeRegExp);
thisFragment.replace(findSize, QLatin1String("<big "));
thisFragment.replace(findSize, QStringLiteral("<big "));
}
{
const QString sizeCloseRegExp = QStringLiteral("< / h\\d >").replace(' ', optionalSpace);
const QRegularExpression closeSize(sizeCloseRegExp);
thisFragment.replace(closeSize, QLatin1String("</big><br />"));
thisFragment.replace(closeSize, QStringLiteral("</big><br />"));
}
}
......@@ -208,14 +208,14 @@ QString QtHelpDocumentation::description() const
const QString end = QStringLiteral("< /p >").replace(' ', optionalSpace);
const QRegularExpression findEnd(end);
thisFragment.replace(findEnd, QLatin1String("<br />"));
thisFragment.replace(findEnd, QStringLiteral("<br />"));
}
{
//Remove links, because they won't work
const QString link = QString("< a href = " + p + ".*?" + p).replace(' ', optionalSpace);
const QRegularExpression exp(link, QRegularExpression::CaseInsensitiveOption);
thisFragment.replace(exp, QLatin1String("<a "));
thisFragment.replace(exp, QStringLiteral("<a "));
}
return thisFragment;
......
......@@ -103,7 +103,7 @@ QNetworkReply *HelpNetworkAccessManager::createRequest(Operation op, const QNetw
// see also: https://bugs.kde.org/show_bug.cgi?id=288277
// firefox seems to add this bullshit mimetype above
// which breaks displaying of qthelp documentation :(
mimeType = QLatin1String("text/html");
mimeType = QStringLiteral("text/html");
}
return new HelpNetworkReply(request, m_helpEngine->fileData(request.url()), mimeType);
}
......
......@@ -68,7 +68,7 @@ void AStyleFormatter::updateFormatter()
bool force = m_options[QStringLiteral("FillForce")].toBool();
AStyleFormatter::setTabSpaceConversionMode(false);
AStyleFormatter::setTabIndentation(wsCount, force );
m_indentString = QLatin1String("\t");
m_indentString = QStringLiteral("\t");
} else {
AStyleFormatter::setSpaceIndentation(wsCount);
m_indentString = QLatin1String("");
......
......@@ -6396,10 +6396,10 @@ bool ASFormatter::isArrayOperator() const
// find next word
size_t nextNum = currentLine.find_first_not_of(" \t", charNum + 1);
if (nextNum == string::npos)
return NULL;
return false;
if (!isLegalNameChar(currentLine[nextNum]))
return NULL;
return false;
// bypass next word and following spaces
while (nextNum < currentLine.length())
......
......@@ -415,7 +415,7 @@ bool isInsideComment(CXTranslationUnit unit, CXFile file, const KTextEditor::Cur
QString& elideStringRight(QString& str, int length)
{
if (str.size() > length + 3) {
return str.replace(length, str.size() - length, QLatin1String("..."));
return str.replace(length, str.size() - length, QStringLiteral("..."));
}
return str;
}
......@@ -1174,7 +1174,7 @@ void ClangCodeCompletionContext::addOverwritableItems()
QList<CompletionTreeItemPointer> overrides;
for (int i = 0; i < overrideList.count(); i++) {
FuncOverrideInfo info = overrideList.at(i);
QString nameAndParams = info.name + QLatin1Char('(') + info.params.join(QLatin1String(", ")) + QLatin1Char(')');
QString nameAndParams = info.name + QLatin1Char('(') + info.params.join(QStringLiteral(", ")) + QLatin1Char(')');
if(info.isConst)
nameAndParams = nameAndParams + QLatin1String(" const");
if(info.isVirtual)
......
......@@ -68,7 +68,7 @@ IndexedTypeIdentifier stripPrefixIdentifiers(const IndexedTypeIdentifier& id, co
int reservedIdentifierCount(const QString &name)
{
QStringList l = name.split(QLatin1String("::"));
QStringList l = name.split(QStringLiteral("::"));
int ret = 0;
foreach(const QString &s, l)
if (s.startsWith(QLatin1Char('_'))) {
......
......@@ -59,7 +59,7 @@ QString MacroNavigationContext::html(bool shorten)
parameterList << parameter.str();
}
const QString parameters = (!parameterList.isEmpty() ?
QStringLiteral("(%1)").arg(parameterList.join(QLatin1String(", "))) :
QStringLiteral("(%1)").arg(parameterList.join(QStringLiteral(", "))) :
QString());
const QUrl url = m_macro->url().toUrl();
......@@ -81,7 +81,7 @@ QString MacroNavigationContext::html(bool shorten)
auto code = m_macro->definition().str();
modifyHtml() += QLatin1String("<p>") + i18n("Body: ");
modifyHtml() += QLatin1String("<tt>") + code.toHtmlEscaped().replace(QStringLiteral("\n"), QStringLiteral("<br/>")) + QLatin1String("</tt>");
modifyHtml() += QLatin1String("</p>");
modifyHtml() += QStringLiteral("</p>");
modifyHtml() += fontSizeSuffix(shorten) + QLatin1String("</p></body></html>");
return currentHtml();
......
......@@ -87,11 +87,11 @@ Defines MsvcCompiler::defines(const QString&) const
// MSVC builtin types
// see http://msdn.microsoft.com/en-us/library/cc953fe1.aspx
{
ret[QStringLiteral("__int8")] = QLatin1String("char");
ret[QStringLiteral("__int16")] = QLatin1String("short");
ret[QStringLiteral("__int32")] = QLatin1String("int");
ret[QStringLiteral("__int64")] = QLatin1String("long long");
ret[QStringLiteral("__int16")] = QLatin1String("short");
ret[QStringLiteral("__int8")] = QStringLiteral("char");
ret[QStringLiteral("__int16")] = QStringLiteral("short");
ret[QStringLiteral("__int32")] = QStringLiteral("int");
ret[QStringLiteral("__int64")] = QStringLiteral("long long");
ret[QStringLiteral("__int16")] = QStringLiteral("short");
ret[QStringLiteral("__ptr32")] = QLatin1String("");
ret[QStringLiteral("__ptr64")] = QLatin1String("");
}
......
......@@ -41,19 +41,19 @@ using namespace KDevelop;
namespace {
namespace ConfigConstants {
const QString configKey = QLatin1String( "CustomDefinesAndIncludes" );
const QString definesKey = QLatin1String( "Defines" );
const QString includesKey = QLatin1String( "Includes" );
const QString projectPathPrefix = QLatin1String( "ProjectPath" );
const QString projectPathKey = QLatin1String( "Path" );
const QString customBuildSystemGroup = QLatin1String( "CustomBuildSystem" );
const QString definesAndIncludesGroup = QLatin1String( "Defines And Includes" );
const QString compilersGroup = QLatin1String( "Compilers" );
const QString compilerNameKey = QLatin1String( "Name" );
const QString compilerPathKey = QLatin1String( "Path" );
const QString compilerTypeKey = QLatin1String( "Type" );
const QString configKey = QStringLiteral( "CustomDefinesAndIncludes" );
const QString definesKey = QStringLiteral( "Defines" );
const QString includesKey = QStringLiteral( "Includes" );
const QString projectPathPrefix = QStringLiteral( "ProjectPath" );
const QString projectPathKey = QStringLiteral( "Path" );
const QString customBuildSystemGroup = QStringLiteral( "CustomBuildSystem" );
const QString definesAndIncludesGroup = QStringLiteral( "Defines And Includes" );
const QString compilersGroup = QStringLiteral( "Compilers" );
const QString compilerNameKey = QStringLiteral( "Name" );
const QString compilerPathKey = QStringLiteral( "Path" );
const QString compilerTypeKey = QStringLiteral( "Type" );
QString parserArgumentsCPP()
{
......
......@@ -61,9 +61,9 @@ void testAddingEntry(SettingsManager* settings, KConfig* config){
auto entry = entries.first();
auto compilers = settings->provider()->compilers();
ConfigEntry otherEntry;
otherEntry.defines[QStringLiteral("TEST")] = QLatin1String("lalal");
otherEntry.defines[QStringLiteral("TEST")] = QStringLiteral("lalal");
otherEntry.includes = QStringList() << QStringLiteral("/foo");
otherEntry.path = QLatin1String("test");
otherEntry.path = QStringLiteral("test");
otherEntry.compiler = compilers.first();
entries << otherEntry;
settings->writePaths(config, entries);
......@@ -147,7 +147,7 @@ void TestCompilerProvider::testStorageBackwardsCompatible()
QCOMPARE(entries.size(), 1);
auto entry = entries.first();
Defines defines;
defines[QStringLiteral("VARIABLE")] = QLatin1String("VALUE");
defines[QStringLiteral("VARIABLE")] = QStringLiteral("VALUE");
defines[QStringLiteral("_DEBUG")] = QString();
QCOMPARE(entry.defines, defines);
QStringList includes = QStringList() << QStringLiteral("/usr/include/mydir");
......@@ -183,12 +183,12 @@ void TestCompilerProvider::testStorageNewSystem()
auto entry = entries.first();
QCOMPARE(entry.path, QString("/"));
Defines defines;
defines[QStringLiteral("VARIABLE")] = QLatin1String("VALUE");
defines[QStringLiteral("VARIABLE")] = QStringLiteral("VALUE");
defines[QStringLiteral("_DEBUG")] = QString();
QCOMPARE(entry.defines, defines);
QMap<QString, QString> includeMap;
includeMap[QStringLiteral("1")] = QLatin1String("/usr/include/mydir");
includeMap[QStringLiteral("2")] = QLatin1String("/usr/local/include/mydir");
includeMap[QStringLiteral("1")] = QStringLiteral("/usr/include/mydir");
includeMap[QStringLiteral("2")] = QStringLiteral("/usr/local/include/mydir");
int i = 0;
for(auto it = includeMap.begin(); it != includeMap.end(); it++)
......@@ -234,7 +234,7 @@ void TestCompilerProvider::testCompilerIncludesAndDefinesForProject()
QVERIFY(mainCompiler->name() == projectCompiler->name());
ConfigEntry entry;
entry.path = QLatin1String("src/main.cpp");
entry.path = QStringLiteral("src/main.cpp");
entry.compiler = compiler;
auto entries = settings->readPaths(project->projectConfiguration().data());
......
......@@ -68,7 +68,7 @@ IProject* ProjectsGenerator::GenerateSimpleProject()
// ./src/main.cpp
// ./.kdev4/simpleproject.kdev4
const QString sp = QLatin1String( "simpleproject" );
const QString sp = QStringLiteral( "simpleproject" );
auto rootFolder = QDir::temp();
QDir(rootFolder.absolutePath() + "/" + sp).removeRecursively();
rootFolder.mkdir( sp );
......@@ -111,7 +111,7 @@ IProject* ProjectsGenerator::GenerateMultiPathProject()
// ./anotherFolder/tst.h
// ./.kdev4/multipathproject.kdev4
const QString mp = QLatin1String( "multipathproject" );
const QString mp = QStringLiteral( "multipathproject" );
auto rootFolder = QDir::temp();
QDir(rootFolder.absolutePath() + "/" + mp).removeRecursively();
rootFolder.mkdir( mp );
......@@ -180,7 +180,7 @@ IProject* ProjectsGenerator::GenerateEmptyProject()
// ./emptyproject.kdev4
// ./.kdev4/emptyproject.kdev4
const QString ep = QLatin1String("emptyproject");
const QString ep = QStringLiteral("emptyproject");
auto rootFolder = QDir::temp();
QDir(rootFolder.absolutePath() + "/" + ep).removeRecursively();
rootFolder.mkdir(ep);
......
......@@ -178,10 +178,10 @@ QList<KDevelop::CompletionTreeItemPointer> CodeCompletionContext::normalCompleti
nullptr,
CompletionItem::NoDecoration);
items << completionsFromImports(nullptr);
items << completionsFromNodeModule(nullptr, QLatin1String("__builtin_ecmascript"));
items << completionsFromNodeModule(nullptr, QStringLiteral("__builtin_ecmascript"));
if (!QmlJS::isQmlFile(m_duContext.data())) {
items << completionsFromNodeModule(nullptr, QLatin1String("__builtin_dom"));
items << completionsFromNodeModule(nullptr, QStringLiteral("__builtin_dom"));
}
}
}
......
......@@ -108,7 +108,7 @@ QVariant CompletionItem::data(const QModelIndex& index, int role, const CodeComp
args.append(arg->toString());
}
return QStringLiteral("(%1)").arg(args.join(QLatin1String(", ")));
return QStringLiteral("(%1)").arg(args.join(QStringLiteral(", ")));
}
}
}
......
......@@ -84,7 +84,7 @@ FunctionCalltipCompletionItem::FunctionCalltipCompletionItem(const DeclarationPo
m_prefix += decl->identifier().toString();
// (arg1, arg2, [currentArgument in m_currentArgument], arg4, arg5)
m_arguments = QLatin1String("(");
m_arguments = QStringLiteral("(");
for (int i=0; i<arguments.count(); ++i) {
if (i > 0) {
......
......@@ -86,7 +86,7 @@ void DeclarationBuilder::startVisiting(QmlJS::AST::Node* node)
if (QmlJS::isQmlFile(currentContext()) && !currentContext()->url().str().contains(QLatin1String("__builtin_qml.qml"))) {
builtinQmlContext = m_session->contextOfFile(
QStandardPaths::locate(QStandardPaths::GenericDataLocation, QLatin1String("kdevqmljssupport/nodejsmodules/__builtin_qml.qml"))
QStandardPaths::locate(QStandardPaths::GenericDataLocation, QStringLiteral("kdevqmljssupport/nodejsmodules/__builtin_qml.qml"))
);
}
......@@ -171,7 +171,7 @@ void DeclarationBuilder::declareFunction(QmlJS::AST::Node* node,
QualifiedIdentifier(name)
));
if (name.last() != Identifier(QLatin1String("Object"))) {
if (name.last() != Identifier(QStringLiteral("Object"))) {
// Every class inherit from Object
QmlJS::importObjectContext(currentContext(), topContext());
}
......@@ -941,7 +941,7 @@ DeclarationBuilder::ExportLiteralsAndNames DeclarationBuilder::exportedNames(Qml
// String literal like "Namespace/Class version".
QStringList nameAndVersion = stringliteral->value.toString().section('/', -1, -1).split(' ');
QString name = nameAndVersion.at(0);
QString version = (nameAndVersion.count() > 1 ? nameAndVersion.at(1) : QLatin1String("1.0"));
QString version = (nameAndVersion.count() > 1 ? nameAndVersion.at(1) : QStringLiteral("1.0"));
if (!knownNames.contains(name)) {
knownNames.insert(name);
......@@ -1008,8 +1008,8 @@ void DeclarationBuilder::importDirectory(const QString& directory, QmlJS::AST::U
entries = QDir(directory).entryInfoList(
QStringList()
<< (QLatin1String("*.") + currentFilePath.section(QLatin1Char('.'), -1, -1))
<< QLatin1String("*.qmltypes")
<< QLatin1String("*.so"),
<< QStringLiteral("*.qmltypes")
<< QStringLiteral("*.so"),
QDir::Files
);
} else if (dir.isFile()) {
......@@ -1110,7 +1110,7 @@ bool DeclarationBuilder::visit(QmlJS::AST::UiObjectDefinition* node)