Use QLatin1String overload for string streaming

GIT_SILENT
parent bf427a95
...@@ -50,9 +50,9 @@ bool askUser(const QString& mainText, ...@@ -50,9 +50,9 @@ bool askUser(const QString& mainText,
QString input; QString input;
forever { forever {
if (ttyDefaultToYes) { if (ttyDefaultToYes) {
out << QStringLiteral("%1: [Y/n] ").arg(ttyPrompt) << flush; out << ttyPrompt << QLatin1String(": [Y/n] ") << flush;
} else { } else {
out << QStringLiteral("%1: [y/N] ").arg(ttyPrompt) << flush; out << ttyPrompt << QLatin1String(": [y/N] ") << flush;
} }
input = in.readLine().trimmed(); input = in.readLine().trimmed();
if (input.isEmpty()) { if (input.isEmpty()) {
......
...@@ -358,7 +358,7 @@ QByteArray ParseSessionData::writeDefinesFile(const QMap<QString, QString>& defi ...@@ -358,7 +358,7 @@ QByteArray ParseSessionData::writeDefinesFile(const QMap<QString, QString>& defi
{ {
continue; continue;
} }
definesStream << QStringLiteral("#define ") << it.key() << ' ' << it.value() << '\n'; definesStream << QLatin1String("#define ") << it.key() << ' ' << it.value() << '\n';
} }
} }
m_definesFile.close(); m_definesFile.close();
......
...@@ -100,30 +100,30 @@ QString Job::buildMakefile(const JobParameters& params) ...@@ -100,30 +100,30 @@ QString Job::buildMakefile(const JobParameters& params)
// Since GNU make (and maybe other make versions) fails on files/paths with whitespaces // Since GNU make (and maybe other make versions) fails on files/paths with whitespaces
// we should perform space-escaping procedure for all potential strings. // we should perform space-escaping procedure for all potential strings.
scriptStream << QStringLiteral("SOURCES ="); scriptStream << QLatin1String("SOURCES =");
for (const QString& source : params.sources()) { for (const QString& source : params.sources()) {
scriptStream << QStringLiteral(" %1").arg(spaceEscapedString(source)); scriptStream << QLatin1Char(' ') << spaceEscapedString(source);
} }
scriptStream << QLatin1Char('\n'); scriptStream << QLatin1Char('\n');
scriptStream << QStringLiteral("COMMAND ="); scriptStream << QLatin1String("COMMAND =");
if (!GlobalSettings::verboseOutput()) { if (!GlobalSettings::verboseOutput()) {
scriptStream << QLatin1Char('@'); scriptStream << QLatin1Char('@');
} }
const auto commandLine = params.commandLine(); const auto commandLine = params.commandLine();
for (const QString& commandPart : commandLine) { for (const QString& commandPart : commandLine) {
scriptStream << QStringLiteral(" %1").arg(spaceEscapedString(commandPart)); scriptStream << QLatin1Char(' ') << spaceEscapedString(commandPart);
} }
scriptStream << QLatin1Char('\n'); scriptStream << QLatin1Char('\n');
scriptStream << QStringLiteral(".PHONY: all $(SOURCES)\n"); scriptStream << QLatin1String(".PHONY: all $(SOURCES)\n");
scriptStream << QStringLiteral("all: $(SOURCES)\n"); scriptStream << QLatin1String("all: $(SOURCES)\n");
scriptStream << QStringLiteral("$(SOURCES):\n"); scriptStream << QLatin1String("$(SOURCES):\n");
scriptStream << QStringLiteral("\t@echo 'Clazy check started for $@'\n"); scriptStream << QLatin1String("\t@echo 'Clazy check started for $@'\n");
// Wrap filename ($@) with quotas to handle "whitespaced" file names. // Wrap filename ($@) with quotas to handle "whitespaced" file names.
scriptStream << QStringLiteral("\t$(COMMAND) '$@'\n"); scriptStream << QLatin1String("\t$(COMMAND) '$@'\n");
scriptStream << QStringLiteral("\t@echo 'Clazy check finished for $@'\n"); scriptStream << QLatin1String("\t@echo 'Clazy check finished for $@'\n");
makefile.close(); makefile.close();
......
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