aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/corelib/api')
-rw-r--r--src/lib/corelib/api/internaljobs.cpp2
-rw-r--r--src/lib/corelib/api/languageinfo.cpp2
-rw-r--r--src/lib/corelib/api/projectdata.cpp6
-rw-r--r--src/lib/corelib/api/projectfileupdater.cpp7
-rw-r--r--src/lib/corelib/api/qmljsrewriter.cpp10
-rw-r--r--src/lib/corelib/api/runenvironment.cpp24
6 files changed, 26 insertions, 25 deletions
diff --git a/src/lib/corelib/api/internaljobs.cpp b/src/lib/corelib/api/internaljobs.cpp
index 19496c83f..4d06821fd 100644
--- a/src/lib/corelib/api/internaljobs.cpp
+++ b/src/lib/corelib/api/internaljobs.cpp
@@ -329,7 +329,7 @@ void InternalSetupProjectJob::resolveProjectFromScratch(ScriptEngine *engine)
void InternalSetupProjectJob::resolveBuildDataFromScratch(const RulesEvaluationContextPtr &evalContext)
{
- TimedActivityLogger resolveLogger(logger(), QLatin1String("Resolving build project"), timed());
+ TimedActivityLogger resolveLogger(logger(), QStringLiteral("Resolving build project"), timed());
BuildDataResolver(logger()).resolveBuildData(m_newProject, evalContext);
}
diff --git a/src/lib/corelib/api/languageinfo.cpp b/src/lib/corelib/api/languageinfo.cpp
index 840dfdf2b..cb023927a 100644
--- a/src/lib/corelib/api/languageinfo.cpp
+++ b/src/lib/corelib/api/languageinfo.cpp
@@ -69,7 +69,7 @@ std::string LanguageInfo::qmlTypeInfo()
result.append(utf8TypeName);
result.append(" ");
const auto v = builtins.languageVersion();
- result.append(QString::fromLatin1("%1.%2")
+ result.append(QStringLiteral("%1.%2")
.arg(v.majorVersion()).arg(v.minorVersion()).toUtf8());
result.append("\" ]\n");
result.append(" prototype: \"QQuickItem\"\n");
diff --git a/src/lib/corelib/api/projectdata.cpp b/src/lib/corelib/api/projectdata.cpp
index 9fe41d707..04c04ad25 100644
--- a/src/lib/corelib/api/projectdata.cpp
+++ b/src/lib/corelib/api/projectdata.cpp
@@ -558,8 +558,8 @@ QList<ArtifactData> ProductData::installableArtifacts() const
QString ProductData::targetExecutable() const
{
QBS_ASSERT(isValid(), return QString());
- if (d->moduleProperties.getModuleProperty(QLatin1String("bundle"),
- QLatin1String("isBundle")).toBool()) {
+ if (d->moduleProperties.getModuleProperty(QStringLiteral("bundle"),
+ QStringLiteral("isBundle")).toBool()) {
for (const ArtifactData &ta : targetArtifacts()) {
if (ta.fileTags().contains(QLatin1String("bundle.application-executable"))) {
if (ta.installData().isInstallable())
@@ -886,7 +886,7 @@ static QString mapToString(const QVariantMap &map, const QString &prefix)
if (val.type() == QVariant::Map) {
stringRep += mapToString(val.value<QVariantMap>(), prefix + key + QLatin1Char('.'));
} else {
- stringRep += QString::fromLatin1("%1%2: %3\n")
+ stringRep += QStringLiteral("%1%2: %3\n")
.arg(prefix, key, toJSLiteral(val));
}
}
diff --git a/src/lib/corelib/api/projectfileupdater.cpp b/src/lib/corelib/api/projectfileupdater.cpp
index 25c2705d1..944de7161 100644
--- a/src/lib/corelib/api/projectfileupdater.cpp
+++ b/src/lib/corelib/api/projectfileupdater.cpp
@@ -378,7 +378,7 @@ void ProjectFileFilesAdder::doApply(QString &fileContent, UiProgram *ast)
// It cannot be the other way around, since the existing right-hand side could
// have string type.
- filesRepresentation += QString::fromLatin1(".concat(%1)").arg(rhsRepr);
+ filesRepresentation += QStringLiteral(".concat(%1)").arg(rhsRepr);
}
}
@@ -468,10 +468,11 @@ void ProjectFileFilesRemover::doApply(QString &fileContent, UiProgram *ast)
throw ErrorInfo(Tr::tr("The following files were not found in the 'files' list: %1")
.arg(filesToRemove.join(QLatin1String(", "))), bindingLocation);
}
- QString filesString = QLatin1String("[\n");
+ QString filesString;
+ filesString += QLatin1String("[\n");
for (const QString &file : qAsConst(newFilesList)) {
filesString += QString(arrayElemIndentation, QLatin1Char(' '));
- filesString += QString::fromLatin1("\"%1\",\n").arg(file);
+ filesString += QStringLiteral("\"%1\",\n").arg(file);
}
filesString += QString(bindingIndentation, QLatin1Char(' '));
filesString += QLatin1Char(']');
diff --git a/src/lib/corelib/api/qmljsrewriter.cpp b/src/lib/corelib/api/qmljsrewriter.cpp
index baf1f3e2c..6ddd7d5a6 100644
--- a/src/lib/corelib/api/qmljsrewriter.cpp
+++ b/src/lib/corelib/api/qmljsrewriter.cpp
@@ -132,15 +132,15 @@ Rewriter::Range Rewriter::addBinding(AST::UiObjectInitializer *ast,
QString newPropertyTemplate;
switch (bindingType) {
case ArrayBinding:
- newPropertyTemplate = QLatin1String("%1: [\n%2\n]");
+ newPropertyTemplate = QStringLiteral("%1: [\n%2\n]");
break;
case ObjectBinding:
- newPropertyTemplate = QLatin1String("%1: %2");
+ newPropertyTemplate = QStringLiteral("%1: %2");
break;
case ScriptBinding:
- newPropertyTemplate = QLatin1String("%1: %2");
+ newPropertyTemplate = QStringLiteral("%1: %2");
break;
default:
@@ -250,7 +250,7 @@ UiObjectMemberList *Rewriter::searchMemberToInsertAfter(UiObjectMemberList *memb
else if (auto scriptBinding = cast<UiScriptBinding*>(member))
orderedMembers[toString(scriptBinding->qualifiedId)] = iter;
else if (cast<UiPublicMember*>(member))
- orderedMembers[QLatin1String("property")] = iter;
+ orderedMembers[QStringLiteral("property")] = iter;
}
int idx = propertyOrder.indexOf(propertyName);
@@ -592,7 +592,7 @@ UiObjectMemberList *QMLRewriter::searchMemberToInsertAfter(UiObjectMemberList *m
else if (UiScriptBinding *scriptBinding = cast<UiScriptBinding*>(member))
orderedMembers[toString(scriptBinding->qualifiedId)] = iter;
else if (cast<UiPublicMember*>(member))
- orderedMembers[QLatin1String("property")] = iter;
+ orderedMembers[QStringLiteral("property")] = iter;
}
int idx = propertyOrder.indexOf(propertyName);
diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp
index bf973cbc4..3e0d045ec 100644
--- a/src/lib/corelib/api/runenvironment.cpp
+++ b/src/lib/corelib/api/runenvironment.cpp
@@ -188,10 +188,10 @@ int RunEnvironment::doRunShell()
qputenv(key.toLocal8Bit().constData(), environment.value(key).toLocal8Bit());
QString command;
if (HostOsInfo::isWindowsHost()) {
- command = environment.value(QLatin1String("COMSPEC"));
+ command = environment.value(QStringLiteral("COMSPEC"));
if (command.isEmpty())
- command = QLatin1String("cmd");
- const QString prompt = environment.value(QLatin1String("PROMPT"));
+ command = QStringLiteral("cmd");
+ const QString prompt = environment.value(QStringLiteral("PROMPT"));
command += QLatin1String(" /k prompt [qbs] ") + prompt;
} else {
const QVariantMap qbsProps =
@@ -201,7 +201,7 @@ int RunEnvironment::doRunShell()
const QString profileName = qbsProps.value(StringConstants::profileProperty()).toString();
command = Preferences(d->settings, profileName).shell();
if (command.isEmpty())
- command = environment.value(QLatin1String("SHELL"), QLatin1String("/bin/sh"));
+ command = environment.value(QStringLiteral("SHELL"), QStringLiteral("/bin/sh"));
// Yes, we have to use this procedure. PS1 is not inherited from the environment.
const QString prompt = QLatin1String("qbs ") + configName
@@ -286,9 +286,9 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
{
d->checkProduct();
const QStringList targetOS = d->resolvedProduct->moduleProperties->qbsPropertyValue(
- QLatin1String("targetOS")).toStringList();
+ QStringLiteral("targetOS")).toStringList();
const QStringList toolchain = d->resolvedProduct->moduleProperties->qbsPropertyValue(
- QLatin1String("toolchain")).toStringList();
+ QStringLiteral("toolchain")).toStringList();
QString targetExecutable = targetBin;
QStringList targetArguments = arguments;
@@ -403,24 +403,24 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
// Run Windows executables through Wine when not on Windows
if (!HostOsInfo::isWindowsHost()) {
targetArguments.prepend(targetExecutable);
- targetExecutable = QLatin1String("wine");
+ targetExecutable = QStringLiteral("wine");
}
}
if (toolchain.contains(QLatin1String("mono"))) {
targetArguments.prepend(targetExecutable);
- targetExecutable = QLatin1String("mono");
+ targetExecutable = QStringLiteral("mono");
}
if (completeSuffix == QLatin1String("js")) {
targetExecutable = d->resolvedProduct->moduleProperties->moduleProperty(
- QLatin1String("nodejs"), QLatin1String("interpreterFilePath")).toString();
+ QStringLiteral("nodejs"), QStringLiteral("interpreterFilePath")).toString();
if (targetExecutable.isEmpty())
// The Node.js binary is called nodejs on Debian/Ubuntu-family operating systems due to
// conflict with another package containing a binary named node
targetExecutable = findExecutable(QStringList()
- << QLatin1String("nodejs")
- << QLatin1String("node"));
+ << QStringLiteral("nodejs")
+ << QStringLiteral("node"));
targetArguments.prepend(targetBin);
}
@@ -434,7 +434,7 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg
}
QProcessEnvironment env = d->environment;
- env.insert(QLatin1String("QBS_RUN_FILE_PATH"), targetBin);
+ env.insert(QStringLiteral("QBS_RUN_FILE_PATH"), targetBin);
EnvironmentScriptRunner(d->resolvedProduct.get(), &d->evalContext, env)
.setupForRun(d->setupRunEnvConfig);