Commit e2584f69 authored by Kai Koehne's avatar Kai Koehne Committed by hjk
Browse files

Replace QLatin1String("x") with QLatin1Char('x') where possible



Change-Id: I2f90c8ae7b5e968b9de882833f8661ab540a9232
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent d4a7505a
......@@ -125,43 +125,43 @@ void NamePrettyPrinter::visit(const OperatorNameId *name)
_name += QLatin1String("delete[]");
break;
case OperatorNameId::PlusOp:
_name += QLatin1String("+");
_name += QLatin1Char('+');
break;
case OperatorNameId::MinusOp:
_name += QLatin1String("-");
_name += QLatin1Char('-');
break;
case OperatorNameId::StarOp:
_name += QLatin1String("*");
_name += QLatin1Char('*');
break;
case OperatorNameId::SlashOp:
_name += QLatin1String("/");
_name += QLatin1Char('/');
break;
case OperatorNameId::PercentOp:
_name += QLatin1String("%");
_name += QLatin1Char('%');
break;
case OperatorNameId::CaretOp:
_name += QLatin1String("^");
_name += QLatin1Char('^');
break;
case OperatorNameId::AmpOp:
_name += QLatin1String("&");
_name += QLatin1Char('&');
break;
case OperatorNameId::PipeOp:
_name += QLatin1String("|");
_name += QLatin1Char('|');
break;
case OperatorNameId::TildeOp:
_name += QLatin1String("~");
_name += QLatin1Char('~');
break;
case OperatorNameId::ExclaimOp:
_name += QLatin1String("!");
_name += QLatin1Char('!');
break;
case OperatorNameId::EqualOp:
_name += QLatin1String("=");
_name += QLatin1Char('=');
break;
case OperatorNameId::LessOp:
_name += QLatin1String("<");
_name += QLatin1Char('<');
break;
case OperatorNameId::GreaterOp:
_name += QLatin1String(">");
_name += QLatin1Char('>');
break;
case OperatorNameId::PlusEqualOp:
_name += QLatin1String("+=");
......@@ -224,7 +224,7 @@ void NamePrettyPrinter::visit(const OperatorNameId *name)
_name += QLatin1String("--");
break;
case OperatorNameId::CommaOp:
_name += QLatin1String(",");
_name += QLatin1Char(',');
break;
case OperatorNameId::ArrowStarOp:
_name += QLatin1String("->*");
......
......@@ -320,7 +320,7 @@ void TypePrettyPrinter::prependSpaceBeforeIndirection(const FullySpecifiedType &
const bool elementIsConstPointerOrReference = elementTypeIsPointerOrReference && type.isConst();
const bool shouldBindToLeftSpecifier = _overview->starBindFlags & Overview::BindToLeftSpecifier;
if (elementIsConstPointerOrReference && ! shouldBindToLeftSpecifier)
_text.prepend(QLatin1String(" "));
_text.prepend(QLatin1Char(' '));
}
void TypePrettyPrinter::prependSpaceAfterIndirection(bool hasName)
......@@ -340,7 +340,7 @@ void TypePrettyPrinter::prependSpaceAfterIndirection(bool hasName)
const bool case3 = ! hasCvSpecifier && ! shouldBindToIdentifier
&& ! _isIndirectionToArrayOrFunction && _text.size() && _text.at(0).isLetter();
if (case1 || case2 || case3)
_text.prepend(QLatin1String(" "));
_text.prepend(QLatin1Char(' '));
}
void TypePrettyPrinter::visit(PointerType *type)
......
......@@ -95,7 +95,7 @@ QString FakeMetaEnum::describe(int baseIndent) const
res += QString::number(m_values.value(i, -1));
}
res += newLine;
res += QLatin1String("}");
res += QLatin1Char('}');
return res;
}
......@@ -195,7 +195,7 @@ QString FakeMetaMethod::describe(int baseIndent) const
res += QLatin1String(" ");
res += pName;
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += newLine;
res += QLatin1String(" parameterTypes:[");
foreach (const QString &pType, parameterTypes()) {
......@@ -203,9 +203,9 @@ QString FakeMetaMethod::describe(int baseIndent) const
res += QLatin1String(" ");
res += pType;
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += newLine;
res += QLatin1String("}");
res += QLatin1Char('}');
return res;
}
......@@ -281,7 +281,7 @@ QString FakeMetaProperty::describe(int baseIndent) const
res += QLatin1String(" isWritable:");
res += isWritable();
res += newLine;
res += QLatin1String("}");
res += QLatin1Char('}');
return res;
}
......@@ -485,7 +485,7 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const
if (!printDetails)
return res;
QString newLine = QString::fromLatin1("\n") + QString::fromLatin1(" ").repeated(baseIndent);
res += QLatin1String("{");
res += QLatin1Char('{');
res += newLine;
res += QLatin1String("className:");
res += className();
......@@ -518,7 +518,7 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const
res += QLatin1String(" ");
res += e.describe(baseIndent + 2);
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += newLine;
res += QLatin1String("enums:[");
......@@ -528,7 +528,7 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const
res += QLatin1String(" ");
res += e.describe(baseIndent + 2);
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += newLine;
res += QLatin1String("properties:[");
......@@ -538,7 +538,7 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const
res += QLatin1String(" ");
res += prop.describe(baseIndent + 2);
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += QLatin1String("methods:[");
for (int iMethod = 0; iMethod < methodOffset() ; ++ iMethod) {
FakeMetaMethod m = method(methodOffset() + iMethod);
......@@ -546,9 +546,9 @@ QString FakeMetaObject::describe(bool printDetails, int baseIndent) const
res += QLatin1String(" ");
m.describe(baseIndent + 2);
}
res += QLatin1String("]");
res += QLatin1Char(']');
res += newLine;
res += QLatin1String("}");
res += QLatin1Char('}');
return res;
}
......@@ -590,7 +590,7 @@ QString FakeMetaObject::Export::describe(int baseIndent) const
res += QLatin1String(" isValid:");
res += QString::number(isValid());
res += newLine;
res += QLatin1String("}");
res += QLatin1Char('}');
return res;
}
......
......@@ -266,7 +266,7 @@ void ContextPaneWidgetRectangle::timerEvent(QTimerEvent *event)
str += QLatin1String("color: ") + QLatin1String("\"") + stop.second.name() + QLatin1String("\";\n");
str += QLatin1String("}\n");
}
str += QLatin1String("}");
str += QLatin1Char('}');
emit propertyChanged(QLatin1String("gradient"), str);
}
}
......
......@@ -379,7 +379,7 @@ int QmlJSIndenter::indentForContinuationLine()
*/
if (!isContinuationLine())
return indentOfLine(*yyLine);
} else if (isContinuationLine() || yyLine->endsWith(QLatin1String(","))) {
} else if (isContinuationLine() || yyLine->endsWith(QLatin1Char(','))) {
/*
We have
......
......@@ -200,25 +200,25 @@ QString PropertyInfo::toString() const
}
if (isWriteable()) {
if (join)
res += QLatin1String("|");
res += QLatin1Char('|');
res += QLatin1String("Writeable");
join = true;
}
if (isList()) {
if (join)
res += QLatin1String("|");
res += QLatin1Char('|');
res += QLatin1String("ListType");
join = true;
}
if (canBePointer()) {
if (join)
res += QLatin1String("|");
res += QLatin1Char('|');
res += QLatin1String("Pointer");
join = true;
}
if (canBeValue()) {
if (join)
res += QLatin1String("|");
res += QLatin1Char('|');
res += QLatin1String("Value");
join = true;
}
......
......@@ -563,7 +563,7 @@ bool LineInfo::isUnfinishedLine()
unf = true;
// ### This only checks one line back.
} else if (readLine() && yyLine->endsWith(QLatin1String(";")) && hasUnclosedParenOrBracket()) {
} else if (readLine() && yyLine->endsWith(QLatin1Char(';')) && hasUnclosedParenOrBracket()) {
/*
Exception:
......
......@@ -324,7 +324,7 @@ void PluginDumper::qmlPluginTypeDumpDone(int exitCode)
CppQmlTypesLoader::BuiltinObjects objectsList;
QList<ModuleApiInfo> moduleApis;
CppQmlTypesLoader::parseQmlTypeDescriptions(output, &objectsList, &moduleApis, &error, &warning,
QLatin1String("<dump of ") + libraryPath + QLatin1String(">"));
QLatin1String("<dump of ") + libraryPath + QLatin1Char('>'));
if (exitCode == 0) {
if (!error.isEmpty()) {
libraryInfo.setPluginTypeInfoStatus(LibraryInfo::DumpError,
......
......@@ -119,7 +119,7 @@ QString QrcParser::normalizedQrcFilePath(const QString &path) {
while (endPrefix + 1 < path.size() && path.at(endPrefix+1) == QLatin1Char('/'))
++endPrefix;
normPath = path.right(path.size()-endPrefix);
if (!normPath.startsWith(QLatin1String("/")))
if (!normPath.startsWith(QLatin1Char('/')))
normPath.insert(0, QLatin1Char('/'));
return normPath;
}
......
......@@ -99,7 +99,7 @@ SftpFileSystemModel::SftpFileSystemModel(QObject *parent)
: QAbstractItemModel(parent), d(new SftpFileSystemModelPrivate)
{
d->sshConnection = 0;
d->rootDirectory = QLatin1String("/");
d->rootDirectory = QLatin1Char('/');
d->rootNode = 0;
d->statJobId = SftpInvalidJob;
}
......
......@@ -172,7 +172,7 @@ bool FileNameValidatingLineEdit::validateFileNameExtension(const QString &fileNa
// file extension
if (!requiredExtensions.isEmpty()) {
foreach (const QString &requiredExtension, requiredExtensions) {
QString extension = QLatin1String(".") + requiredExtension;
QString extension = QLatin1Char('.') + requiredExtension;
if (fileName.endsWith(extension, Qt::CaseSensitive) && extension.count() < fileName.count())
return true;
}
......
......@@ -70,7 +70,7 @@ struct NewClassWidgetPrivate {
};
NewClassWidgetPrivate:: NewClassWidgetPrivate() :
m_headerExtension(QLatin1String("h")),
m_headerExtension(QLatin1Char('h')),
m_sourceExtension(QLatin1String("cpp")),
m_formExtension(QLatin1String("ui")),
m_valid(false),
......
......@@ -46,7 +46,7 @@ void CommentDefinition::setStyle(Style style)
multiLineEnd = QLatin1String("*/");
break;
case HashStyle:
singleLine = QLatin1String("#");
singleLine = QLatin1Char('#');
multiLineStart.clear();
multiLineEnd.clear();
break;
......
......@@ -1250,7 +1250,7 @@ void AndroidConfigurations::load()
int major = -1;
int minor = -1;
foreach (const QString &version, allVersions) {
QStringList parts = version.split(QLatin1String("."));
QStringList parts = version.split(QLatin1Char('.'));
if (parts.size() != 2) // not interested in 1.7.0_u21
continue;
bool okMajor, okMinor;
......
......@@ -260,7 +260,7 @@ void AndroidSettingsWidget::check(AndroidSettingsWidget::Mode mode)
m_ndkState = Error;
m_ndkErrorMessage = tr("\"%1\" does not seem to be an Android NDK top folder.")
.arg(m_androidConfig.ndkLocation().toUserOutput());
} else if (platformPath.toString().contains(QLatin1String(" "))) {
} else if (platformPath.toString().contains(QLatin1Char(' '))) {
m_ndkState = Error;
m_ndkErrorMessage = tr("The Android NDK cannot be installed into a path with spaces.");
} else {
......
......@@ -102,7 +102,7 @@ DebuggerStartParameters BareMetalRunControlFactory::startParameters(const BareMe
if (device->sshParameters().host.startsWith(QLatin1Char('|'))) //gdb pipe mode enabled
params.remoteChannel = device->sshParameters().host;
else
params.remoteChannel = device->sshParameters().host + QLatin1String(":") + QString::number(device->sshParameters().port);
params.remoteChannel = device->sshParameters().host + QLatin1Char(':') + QString::number(device->sshParameters().port);
params.remoteSetupNeeded = false; // qml stuff, not needed
params.commandsAfterConnect = device->gdbInitCommands().toLatin1();
params.commandsForReset = device->gdbResetCommands().toLatin1();
......
......@@ -138,7 +138,7 @@ Command ClangFormat::command(int offset, int length) const
} else {
command.addOption(QLatin1String("-style={")
+ m_settings->style(m_settings->customStyle()).remove(QLatin1Char('\n'))
+ QLatin1String("}"));
+ QLatin1Char('}'));
}
if (offset != -1) {
......
......@@ -383,7 +383,7 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple
}
const QString text = Internal::getQString(clang_getCompletionChunkText(cxString, index), false);
if (chunkKind == CXCompletionChunk_ResultType) {
hintPrefix += QLatin1String("(");
hintPrefix += QLatin1Char('(');
hintPrefix += text.toHtmlEscaped();
hintPrefix += QLatin1String(") ");
indentBonus += 3 + text.length();
......
......@@ -294,7 +294,7 @@ void CXPrettyPrinter::writeCompletionContexts(CXCodeCompleteResults *results)
foreach (const QString &line, lines) {
writeLineEnd();
m_printed += line + QLatin1String(",");
m_printed += line + QLatin1Char(',');
}
}
......@@ -381,7 +381,7 @@ void CXPrettyPrinter::writeCompletionAnnotationJson(const CXCompletionString &st
void CXPrettyPrinter::writeDiagnosticJson(const CXDiagnostic &diag)
{
m_printed += QLatin1String("{");
m_printed += QLatin1Char('{');
m_indent += 4;
writeLineEnd();
......@@ -410,7 +410,7 @@ void CXPrettyPrinter::writeDiagnosticJson(const CXDiagnostic &diag)
writeFixItJson(diag, i);
writeLineEnd();
}
m_printed += QLatin1String("]");
m_printed += QLatin1Char(']');
writeLineEnd();
}
......@@ -448,7 +448,7 @@ void CXPrettyPrinter::writeDiagnosticJson(const CXDiagnostic &diag)
}
m_indent -= 4;
writeLineEnd();
m_printed += QLatin1String("]");
m_printed += QLatin1Char(']');
}
// children
......@@ -465,12 +465,12 @@ void CXPrettyPrinter::writeDiagnosticJson(const CXDiagnostic &diag)
}
m_indent -= 4;
writeLineEnd();
m_printed += QLatin1String("]");
m_printed += QLatin1Char(']');
}
m_indent -= 4;
writeLineEnd();
m_printed += QLatin1String("}");
m_printed += QLatin1Char('}');
}
void CXPrettyPrinter::writeFixItJson(const CXDiagnostic &diag, unsigned i)
......@@ -483,7 +483,7 @@ void CXPrettyPrinter::writeFixItJson(const CXDiagnostic &diag, unsigned i)
m_printed += text;
m_printed += QLatin1String("\', range: ");
writeRangeJson(range);
m_printed += QLatin1String("}");
m_printed += QLatin1Char('}');
}
void CXPrettyPrinter::writeRangeJson(const CXSourceRange &range)
......@@ -531,7 +531,7 @@ void CXPrettyPrinter::writeLocationJson(const CXSourceLocation &location)
m_printed += QLatin1String("line: ");
m_printed += QString::number(loc.line());
m_printed += QLatin1String(",");
m_printed += QLatin1Char(',');
writeLineEnd();
m_printed += QLatin1String("column: ");
......@@ -539,7 +539,7 @@ void CXPrettyPrinter::writeLocationJson(const CXSourceLocation &location)
m_indent -= 4;
writeLineEnd();
m_printed += QLatin1String("}");
m_printed += QLatin1Char('}');
}
void CXPrettyPrinter::writeLineEnd()
......
......@@ -96,7 +96,7 @@ QVariant TreeItemModel::data(const QModelIndex &index, int role) const
QString name(inf.name());
if (!inf.type().isEmpty())
name += QLatin1String(" ") + inf.type();
name += QLatin1Char(' ') + inf.type();
return name;
}
......
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