Commit 22d3eac3 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau
Browse files

Use more QStringLiteral for raw strings which end used as QString

Powered by (kdev)clazy
parent 131bc373
......@@ -699,7 +699,7 @@ int main( int argc, char *argv[] )
}
}
if (parser.isSet("project")) {
if (parser.isSet(QStringLiteral("project"))) {
const auto project = parser.value(QStringLiteral("project"));
QFileInfo info(project);
QUrl projectUrl;
......
......@@ -794,7 +794,7 @@ QString AbstractDeclarationNavigationContext::declarationSizeInformation(const D
// but normally leaves the bitOffsetOf unset (-1).
const ClassMemberDeclaration* memberDecl = dynamic_cast<const ClassMemberDeclaration*>(decl.data());
if (memberDecl && (memberDecl->bitOffsetOf() > 0 || memberDecl->sizeOf() > 0 || memberDecl->alignOf() > 0)) {
QString sizeInfo = "<p>";
QString sizeInfo = QStringLiteral("<p>");
if (memberDecl->bitOffsetOf() >= 0) {
const auto byteOffset = memberDecl->bitOffsetOf() / 8;
......@@ -812,7 +812,7 @@ QString AbstractDeclarationNavigationContext::declarationSizeInformation(const D
sizeInfo += i18n("aligned to: %1 Bytes", memberDecl->alignOf());
}
sizeInfo += "</p>";
sizeInfo += QStringLiteral("</p>");
return sizeInfo;
}
......
......@@ -121,7 +121,7 @@ void CMakeCacheDelegate::setModelData(QWidget * editor, QAbstractItemModel * mod
if(type==QLatin1String("BOOL"))
{
QCheckBox *boolean=qobject_cast<QCheckBox*>(editor);
value = boolean->isChecked() ? "ON" : "OFF";
value = boolean->isChecked() ? QStringLiteral("ON") : QStringLiteral("OFF");
}
else if(type==QLatin1String("PATH") || type==QLatin1String("FILEPATH"))
{
......
......@@ -78,7 +78,7 @@ void Resource::getOrgs(const QString &token)
void Resource::authenticate(const QString &name, const QString &password)
{
auto job = createHttpAuthJob(QLatin1String("Authorization: Basic ") + QString::fromUtf8(QByteArray(name.toUtf8() + ':' + password.toUtf8()).toBase64()));
job->addMetaData("PropagateHttpHeader","true");
job->addMetaData(QStringLiteral("PropagateHttpHeader"), QStringLiteral("true"));
connect(job, &KIO::StoredTransferJob::result,
this, &Resource::slotAuthenticate);
job->start();
......
......@@ -210,7 +210,7 @@ void Parser::expectedToken(int /*expected*/, qint64 /*where*/, const QString& na
{
reportProblem(
Parser::Error,
QString("Expected token \"%1\"").arg(name));
QStringLiteral("Expected token \"%1\"").arg(name));
}
void Parser::expectedSymbol(int /*expected_symbol*/, const QString& name)
......@@ -225,9 +225,9 @@ void Parser::expectedSymbol(int /*expected_symbol*/, const QString& name)
QString tokenValue = tokenText(token.begin, token.end);
reportProblem(
Parser::Error,
QString("Expected symbol \"%1\" (current token: \"%2\" [%3] at line: %4 col: %5)")
QStringLiteral("Expected symbol \"%1\" (current token: \"%2\" [%3] at line: %4 col: %5)")
.arg(name)
.arg(token.kind != 0 ? tokenValue : "EOF")
.arg(token.kind != 0 ? tokenValue : QStringLiteral("EOF"))
.arg(token.kind)
.arg(line)
.arg(col));
......
......@@ -123,7 +123,7 @@ bool QMakeProjectFile::read()
QStringList QMakeProjectFile::subProjects() const
{
ifDebug(qCDebug(KDEV_QMAKE) << "Fetching subprojects";) QStringList list;
foreach (QString subdir, variableValues("SUBDIRS")) {
foreach (QString subdir, variableValues(QStringLiteral("SUBDIRS"))) {
QString fileOrPath;
ifDebug(qCDebug(KDEV_QMAKE) << "Found value:" << subdir;) if (containsVariable(subdir + ".file")
&& !variableValues(subdir + ".file").isEmpty())
......@@ -360,7 +360,7 @@ QStringList QMakeProjectFile::targets() const
list += QFileInfo(absoluteFile()).baseName();
}
foreach (const QString& target, variableValues("INSTALLS")) {
foreach (const QString& target, variableValues(QStringLiteral("INSTALLS"))) {
if (!target.isEmpty() && target != QLatin1String("target"))
list << target;
}
......@@ -405,7 +405,7 @@ QMakeCache* QMakeProjectFile::qmakeCache() const
QList<QMakeProjectFile::DefinePair> QMakeProjectFile::defines() const
{
QList<DefinePair> d;
foreach (QString def, variableMap()["DEFINES"]) {
foreach (QString def, variableMap()[QStringLiteral("DEFINES")]) {
int pos = def.indexOf('=');
if (pos >= 0) {
// a value is attached to define
......
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