Commit b8e348c4 authored by Tobias Hunger's avatar Tobias Hunger

BuildStep: Do not use QLatin1String/QLatin1Char in BuildSteps

Change-Id: I287831a9151ba867eec443206235c7e07a6176e8
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 0bfa2e80
......@@ -110,7 +110,7 @@ bool AutogenStep::init(QList<const BuildStep *> &earlierSteps)
pp->setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
pp->setWorkingDirectory(projectDir);
pp->setCommand(QLatin1String("./autogen.sh"));
pp->setCommand("./autogen.sh");
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -123,9 +123,9 @@ void AutogenStep::run(QFutureInterface<bool> &fi)
// Check whether we need to run autogen.sh
const QString projectDir(bc->target()->project()->projectDirectory().toString());
const QFileInfo configureInfo(projectDir + QLatin1String("/configure"));
const QFileInfo configureAcInfo(projectDir + QLatin1String("/configure.ac"));
const QFileInfo makefileAmInfo(projectDir + QLatin1String("/Makefile.am"));
const QFileInfo configureInfo(projectDir + "/configure");
const QFileInfo configureAcInfo(projectDir + "/configure.ac");
const QFileInfo makefileAmInfo(projectDir + "/Makefile.am");
if (!configureInfo.exists()
|| configureInfo.lastModified() < configureAcInfo.lastModified()
......@@ -173,13 +173,13 @@ QVariantMap AutogenStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(AUTOGEN_ADDITIONAL_ARGUMENTS_KEY), m_additionalArguments);
map.insert(AUTOGEN_ADDITIONAL_ARGUMENTS_KEY, m_additionalArguments);
return map;
}
bool AutogenStep::fromMap(const QVariantMap &map)
{
m_additionalArguments = map.value(QLatin1String(AUTOGEN_ADDITIONAL_ARGUMENTS_KEY)).toString();
m_additionalArguments = map.value(AUTOGEN_ADDITIONAL_ARGUMENTS_KEY).toString();
return BuildStep::fromMap(map);
}
......@@ -226,7 +226,7 @@ void AutogenStepConfigWidget::updateDetails()
param.setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
param.setWorkingDirectory(projectDir);
param.setCommand(QLatin1String("./autogen.sh"));
param.setCommand("./autogen.sh");
param.setArguments(m_autogenStep->additionalArguments());
m_summaryText = param.summary(displayName());
emit updateSummary();
......
......@@ -111,7 +111,7 @@ bool AutoreconfStep::init(QList<const BuildStep *> &earlierSteps)
pp->setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
pp->setWorkingDirectory(projectDir);
pp->setCommand(QLatin1String("autoreconf"));
pp->setCommand("autoreconf");
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -125,7 +125,7 @@ void AutoreconfStep::run(QFutureInterface<bool> &fi)
// Check whether we need to run autoreconf
const QString projectDir(bc->target()->project()->projectDirectory().toString());
if (!QFileInfo::exists(projectDir + QLatin1String("/configure")))
if (!QFileInfo::exists(projectDir + "/configure"))
m_runAutoreconf = true;
if (!m_runAutoreconf) {
......@@ -168,13 +168,13 @@ QVariantMap AutoreconfStep::toMap() const
{
QVariantMap map = AbstractProcessStep::toMap();
map.insert(QLatin1String(AUTORECONF_ADDITIONAL_ARGUMENTS_KEY), m_additionalArguments);
map.insert(AUTORECONF_ADDITIONAL_ARGUMENTS_KEY, m_additionalArguments);
return map;
}
bool AutoreconfStep::fromMap(const QVariantMap &map)
{
m_additionalArguments = map.value(QLatin1String(AUTORECONF_ADDITIONAL_ARGUMENTS_KEY)).toString();
m_additionalArguments = map.value(AUTORECONF_ADDITIONAL_ARGUMENTS_KEY).toString();
return BuildStep::fromMap(map);
}
......@@ -221,7 +221,7 @@ void AutoreconfStepConfigWidget::updateDetails()
param.setEnvironment(bc->environment());
const QString projectDir(bc->target()->project()->projectDirectory().toString());
param.setWorkingDirectory(projectDir);
param.setCommand(QLatin1String("autoreconf"));
param.setCommand("autoreconf");
param.setArguments(m_autoreconfStep->additionalArguments());
m_summaryText = param.summary(displayName());
emit updateSummary();
......
......@@ -58,9 +58,9 @@ static QString projectDirRelativeToBuildDir(BuildConfiguration *bc) {
QString projDirToBuildDir = buildDir.relativeFilePath(
bc->target()->project()->projectDirectory().toString());
if (projDirToBuildDir.isEmpty())
return QLatin1String("./");
if (!projDirToBuildDir.endsWith(QLatin1Char('/')))
projDirToBuildDir.append(QLatin1Char('/'));
return "./";
if (!projDirToBuildDir.endsWith('/'))
projDirToBuildDir.append('/');
return projDirToBuildDir;
}
......@@ -125,7 +125,7 @@ bool ConfigureStep::init(QList<const BuildStep *> &earlierSteps)
pp->setMacroExpander(bc->macroExpander());
pp->setEnvironment(bc->environment());
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure"));
pp->setCommand(projectDirRelativeToBuildDir(bc) + "configure");
pp->setArguments(additionalArguments());
pp->resolveAll();
......@@ -138,8 +138,8 @@ void ConfigureStep::run(QFutureInterface<bool>& fi)
//Check whether we need to run configure
const QString projectDir(bc->target()->project()->projectDirectory().toString());
const QFileInfo configureInfo(projectDir + QLatin1String("/configure"));
const QFileInfo configStatusInfo(bc->buildDirectory().toString() + QLatin1String("/config.status"));
const QFileInfo configureInfo(projectDir + "/configure");
const QFileInfo configStatusInfo(bc->buildDirectory().toString() + "/config.status");
if (!configStatusInfo.exists()
|| configStatusInfo.lastModified() < configureInfo.lastModified()) {
......@@ -191,13 +191,13 @@ QVariantMap ConfigureStep::toMap() const
{
QVariantMap map = AbstractProcessStep::toMap();
map.insert(QLatin1String(CONFIGURE_ADDITIONAL_ARGUMENTS_KEY), m_additionalArguments);
map.insert(CONFIGURE_ADDITIONAL_ARGUMENTS_KEY, m_additionalArguments);
return map;
}
bool ConfigureStep::fromMap(const QVariantMap &map)
{
m_additionalArguments = map.value(QLatin1String(CONFIGURE_ADDITIONAL_ARGUMENTS_KEY)).toString();
m_additionalArguments = map.value(CONFIGURE_ADDITIONAL_ARGUMENTS_KEY).toString();
return BuildStep::fromMap(map);
}
......@@ -245,7 +245,7 @@ void ConfigureStepConfigWidget::updateDetails()
param.setMacroExpander(bc->macroExpander());
param.setEnvironment(bc->environment());
param.setWorkingDirectory(bc->buildDirectory().toString());
param.setCommand(projectDirRelativeToBuildDir(bc) + QLatin1String("configure"));
param.setCommand(projectDirRelativeToBuildDir(bc) + "configure");
param.setArguments(m_configureStep->additionalArguments());
m_summaryText = param.summaryInWorkdir(displayName());
emit updateSummary();
......
......@@ -60,7 +60,7 @@ const char MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY[] = "AutotoolsProjectManager.MakeS
// MakeStepFactory class
//////////////////////////
MakeStepFactory::MakeStepFactory(QObject *parent) : IBuildStepFactory(parent)
{ setObjectName(QLatin1String("Autotools::MakeStepFactory")); }
{ setObjectName("Autotools::MakeStepFactory"); }
QList<BuildStepInfo> MakeStepFactory::availableSteps(BuildStepList *parent) const
{
......@@ -198,17 +198,17 @@ QVariantMap MakeStep::toMap() const
{
QVariantMap map = AbstractProcessStep::toMap();
map.insert(QLatin1String(BUILD_TARGETS_KEY), m_buildTargets);
map.insert(QLatin1String(MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY), m_additionalArguments);
map.insert(QLatin1String(CLEAN_KEY), m_clean);
map.insert(BUILD_TARGETS_KEY, m_buildTargets);
map.insert(MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY, m_additionalArguments);
map.insert(CLEAN_KEY, m_clean);
return map;
}
bool MakeStep::fromMap(const QVariantMap &map)
{
m_buildTargets = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
m_additionalArguments = map.value(QLatin1String(MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY)).toString();
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
m_buildTargets = map.value(BUILD_TARGETS_KEY).toStringList();
m_additionalArguments = map.value(MAKE_STEP_ADDITIONAL_ARGUMENTS_KEY).toString();
m_clean = map.value(CLEAN_KEY).toBool();
return BuildStep::fromMap(map);
}
......@@ -269,7 +269,7 @@ void MakeStepConfigWidget::updateDetails()
param.setArguments(arguments);
m_summaryText = param.summary(displayName());
} else {
m_summaryText = QLatin1String("<b>") + ToolChainKitInformation::msgNoToolChainInTarget() + QLatin1String("</b>");
m_summaryText = "<b>" + ToolChainKitInformation::msgNoToolChainInTarget() + "</b>";
}
emit updateSummary();
......
......@@ -71,7 +71,7 @@ const char ADD_RUNCONFIGURATION_TEXT[] = "Current executable";
static bool isCurrentExecutableTarget(const QString &target)
{
return target == QLatin1String(ADD_RUNCONFIGURATION_TEXT);
return target == ADD_RUNCONFIGURATION_TEXT;
}
CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl) :
......@@ -95,9 +95,9 @@ CMakeBuildStep::CMakeBuildStep(BuildStepList *bsl, CMakeBuildStep *bs) :
void CMakeBuildStep::ctor(BuildStepList *bsl)
{
m_percentProgress = QRegExp(QLatin1String("^\\[\\s*(\\d*)%\\]"));
m_ninjaProgress = QRegExp(QLatin1String("^\\[\\s*(\\d*)/\\s*(\\d*)"));
m_ninjaProgressString = QLatin1String("[%f/%t "); // ninja: [33/100
m_percentProgress = QRegExp("^\\[\\s*(\\d*)%\\]");
m_ninjaProgress = QRegExp("^\\[\\s*(\\d*)/\\s*(\\d*)");
m_ninjaProgressString = "[%f/%t "; // ninja: [33/100
//: Default display name for the cmake make step.
setDefaultDisplayName(tr("CMake Build"));
......@@ -150,23 +150,23 @@ QVariantMap CMakeBuildStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
// Use QStringList for compatibility with old files
map.insert(QLatin1String(BUILD_TARGETS_KEY), QStringList(m_buildTarget));
map.insert(QLatin1String(TOOL_ARGUMENTS_KEY), m_toolArguments);
map.insert(BUILD_TARGETS_KEY, QStringList(m_buildTarget));
map.insert(TOOL_ARGUMENTS_KEY, m_toolArguments);
return map;
}
bool CMakeBuildStep::fromMap(const QVariantMap &map)
{
if (map.value(QLatin1String(CLEAN_KEY), false).toBool()) {
if (map.value(CLEAN_KEY, false).toBool()) {
m_buildTarget = CMakeBuildStep::cleanTarget();
} else {
const QStringList targetList = map.value(QLatin1String(BUILD_TARGETS_KEY)).toStringList();
const QStringList targetList = map.value(BUILD_TARGETS_KEY).toStringList();
if (!targetList.isEmpty())
m_buildTarget = targetList.last();
m_toolArguments = map.value(QLatin1String(TOOL_ARGUMENTS_KEY)).toString();
m_toolArguments = map.value(TOOL_ARGUMENTS_KEY).toString();
}
if (map.value(QLatin1String(ADD_RUNCONFIGURATION_ARGUMENT_KEY), false).toBool())
m_buildTarget = QLatin1String(ADD_RUNCONFIGURATION_TEXT);
if (map.value(ADD_RUNCONFIGURATION_ARGUMENT_KEY, false).toBool())
m_buildTarget = ADD_RUNCONFIGURATION_TEXT;
return BuildStep::fromMap(map);
}
......@@ -241,8 +241,8 @@ bool CMakeBuildStep::init(QList<const BuildStep *> &earlierSteps)
pp->setMacroExpander(bc->macroExpander());
Utils::Environment env = bc->environment();
Utils::Environment::setupEnglishOutput(&env);
if (!env.value(QLatin1String("NINJA_STATUS")).startsWith(m_ninjaProgressString))
env.set(QLatin1String("NINJA_STATUS"), m_ninjaProgressString + QLatin1String("%o/sec] "));
if (!env.value("NINJA_STATUS").startsWith(m_ninjaProgressString))
env.set("NINJA_STATUS", m_ninjaProgressString + "%o/sec] ");
pp->setEnvironment(env);
pp->setWorkingDirectory(bc->buildDirectory().toString());
pp->setCommand(cmakeCommand());
......@@ -384,8 +384,8 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
{
QString arguments;
Utils::QtcProcess::addArg(&arguments, QLatin1String("--build"));
Utils::QtcProcess::addArg(&arguments, QLatin1String("."));
Utils::QtcProcess::addArg(&arguments, "--build");
Utils::QtcProcess::addArg(&arguments, ".");
QString target;
......@@ -393,17 +393,17 @@ QString CMakeBuildStep::allArguments(const CMakeRunConfiguration *rc) const
if (rc)
target = rc->buildSystemTarget();
else
target = QLatin1String("<i>&lt;") + tr(ADD_RUNCONFIGURATION_TEXT) + QLatin1String("&gt;</i>");
target = "<i>&lt;" + tr(ADD_RUNCONFIGURATION_TEXT) + "&gt;</i>";
} else {
target = m_buildTarget;
}
Utils::QtcProcess::addArg(&arguments, QLatin1String("--target"));
Utils::QtcProcess::addArg(&arguments, "--target");
Utils::QtcProcess::addArg(&arguments, target);
if (!m_toolArguments.isEmpty()) {
Utils::QtcProcess::addArg(&arguments, QLatin1String("--"));
arguments += QLatin1Char(' ') + m_toolArguments;
Utils::QtcProcess::addArg(&arguments, "--");
arguments += ' ' + m_toolArguments;
}
return arguments;
......
......@@ -130,7 +130,7 @@ BuildStepConfigWidget *NimCompilerBuildStep::createConfigWidget()
bool NimCompilerBuildStep::fromMap(const QVariantMap &map)
{
AbstractProcessStep::fromMap(map);
m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split(QLatin1Char('|'));
m_userCompilerOptions = map[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS].toString().split('|');
m_defaultOptions = static_cast<DefaultBuildOptions>(map[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS].toInt());
m_targetNimFile = FileName::fromString(map[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE].toString());
updateProcessParameters();
......@@ -140,7 +140,7 @@ bool NimCompilerBuildStep::fromMap(const QVariantMap &map)
QVariantMap NimCompilerBuildStep::toMap() const
{
QVariantMap result = AbstractProcessStep::toMap();
result[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join(QLatin1Char('|'));
result[Constants::C_NIMCOMPILERBUILDSTEP_USERCOMPILEROPTIONS] = m_userCompilerOptions.join('|');
result[Constants::C_NIMCOMPILERBUILDSTEP_DEFAULTBUILDOPTIONS] = m_defaultOptions;
result[Constants::C_NIMCOMPILERBUILDSTEP_TARGETNIMFILE] = m_targetNimFile.toString();
return result;
......
......@@ -136,14 +136,14 @@ void BuildStep::ctor()
bool BuildStep::fromMap(const QVariantMap &map)
{
m_enabled = map.value(QLatin1String(buildStepEnabledKey), true).toBool();
m_enabled = map.value(buildStepEnabledKey, true).toBool();
return ProjectConfiguration::fromMap(map);
}
QVariantMap BuildStep::toMap() const
{
QVariantMap map = ProjectConfiguration::toMap();
map.insert(QLatin1String(buildStepEnabledKey), m_enabled);
map.insert(buildStepEnabledKey, m_enabled);
return map;
}
......
......@@ -59,9 +59,9 @@ AndroidPackageInstallationStep::AndroidPackageInstallationStep(ProjectExplorer::
bool AndroidPackageInstallationStep::init(QList<const BuildStep *> &earlierSteps)
{
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
QString dirPath = bc->buildDirectory().appendPath(QLatin1String(Android::Constants::ANDROID_BUILDDIRECTORY)).toString();
QString dirPath = bc->buildDirectory().appendPath(Android::Constants::ANDROID_BUILDDIRECTORY).toString();
if (Utils::HostOsInfo::isWindowsHost())
if (bc->environment().searchInPath(QLatin1String("sh.exe")).isEmpty())
if (bc->environment().searchInPath("sh.exe").isEmpty())
dirPath = QDir::toNativeSeparators(dirPath);
ProjectExplorer::ToolChain *tc
......@@ -88,9 +88,9 @@ bool AndroidPackageInstallationStep::init(QList<const BuildStep *> &earlierSteps
m_androidDirsToClean.clear();
// don't remove gradle's cache, it takes ages to rebuild it.
if (!QFile::exists(dirPath + QLatin1String("/build.xml")) && Android::AndroidManager::useGradle(target())) {
m_androidDirsToClean << dirPath + QLatin1String("/assets");
m_androidDirsToClean << dirPath + QLatin1String("/libs");
if (!QFile::exists(dirPath + "/build.xml") && Android::AndroidManager::useGradle(target())) {
m_androidDirsToClean << dirPath + "/assets";
m_androidDirsToClean << dirPath + "/libs";
} else {
m_androidDirsToClean << dirPath;
}
......
......@@ -129,22 +129,22 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
return false;
QString command = version->qmakeProperty("QT_HOST_BINS");
if (!command.endsWith(QLatin1Char('/')))
command += QLatin1Char('/');
command += QLatin1String("androiddeployqt");
if (!command.endsWith('/'))
command += '/';
command += "androiddeployqt";
if (Utils::HostOsInfo::isWindowsHost())
command += QLatin1String(".exe");
command += ".exe";
QString deploymentMethod;
if (m_deployAction == MinistroDeployment)
deploymentMethod = QLatin1String("ministro");
deploymentMethod = "ministro";
else if (m_deployAction == DebugDeployment)
deploymentMethod = QLatin1String("debug");
deploymentMethod = "debug";
else if (m_deployAction == BundleLibrariesDeployment)
deploymentMethod = QLatin1String("bundled");
deploymentMethod = "bundled";
ProjectExplorer::BuildConfiguration *bc = buildConfiguration();
QString outputDir = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
QString outputDir = bc->buildDirectory().appendPath(Constants::ANDROID_BUILDDIRECTORY).toString();
const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
const QmakeProjectManager::QmakeProFileNode *node = pro->rootProjectNode()->findProFileFor(proFilePathForInputFile());
......@@ -165,43 +165,31 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
return false;
}
QStringList arguments;
arguments << QLatin1String("--input")
<< inputFile
<< QLatin1String("--output")
<< outputDir
<< QLatin1String("--deployment")
<< deploymentMethod
<< QLatin1String("--android-platform")
<< AndroidManager::buildTargetSDK(target())
<< QLatin1String("--jdk")
<< AndroidConfigurations::currentConfig().openJDKLocation().toString();
QStringList arguments = {"--input", inputFile,
"--output", outputDir,
"--deployment", deploymentMethod,
"--android-platform", AndroidManager::buildTargetSDK(target()),
"--jdk", AndroidConfigurations::currentConfig().openJDKLocation().toString()};
if (m_verbose)
arguments << QLatin1String("--verbose");
arguments << "--verbose";
if (m_useGradle)
arguments << QLatin1String("--gradle");
arguments << "--gradle";
else
arguments << QLatin1String("--ant")
<< AndroidConfigurations::currentConfig().antToolPath().toString();
arguments << "--ant" << AndroidConfigurations::currentConfig().antToolPath().toString();
QStringList argumentsPasswordConcealed = arguments;
if (m_signPackage) {
arguments << QLatin1String("--sign")
<< m_keystorePath.toString()
<< m_certificateAlias
<< QLatin1String("--storepass")
<< m_keystorePasswd;
argumentsPasswordConcealed << QLatin1String("--sign") << QLatin1String("******")
<< QLatin1String("--storepass") << QLatin1String("******");
arguments << "--sign" << m_keystorePath.toString() << m_certificateAlias
<< "--storepass" << m_keystorePasswd;
argumentsPasswordConcealed << "--sign" << "******"
<< "--storepass" << "******";
if (!m_certificatePasswd.isEmpty()) {
arguments << QLatin1String("--keypass")
<< m_certificatePasswd;
argumentsPasswordConcealed << QLatin1String("--keypass")
<< QLatin1String("******");
arguments << "--keypass" << m_certificatePasswd;
argumentsPasswordConcealed << "--keypass" << "******";
}
}
......@@ -210,9 +198,9 @@ bool QmakeAndroidBuildApkStep::init(QList<const BuildStep *> &earlierSteps)
// params (e.g. --sign) to choose not to add gdbserver
if (version->qtVersion() >= QtSupport::QtVersionNumber(5, 6, 0)) {
if (m_addDebugger || bc->buildType() == ProjectExplorer::BuildConfiguration::Debug)
arguments << QLatin1String("--gdbserver");
arguments << "--gdbserver";
else
arguments << QLatin1String("--no-gdbserver");
arguments << "--no-gdbserver";
}
ProjectExplorer::ProcessParameters *pp = processParameters();
......
......@@ -127,10 +127,10 @@ QString MakeStep::effectiveMakeCommand() const
QVariantMap MakeStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(MAKE_ARGUMENTS_KEY), m_userArgs);
map.insert(QLatin1String(MAKE_COMMAND_KEY), m_makeCmd);
map.insert(QLatin1String(CLEAN_KEY), m_clean);
map.insert(QLatin1String(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY), automaticallyAddedArguments());
map.insert(MAKE_ARGUMENTS_KEY, m_userArgs);
map.insert(MAKE_COMMAND_KEY, m_makeCmd);
map.insert(CLEAN_KEY, m_clean);
map.insert(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY, automaticallyAddedArguments());
return map;
}
......@@ -139,20 +139,20 @@ QStringList MakeStep::automaticallyAddedArguments() const
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit(), ProjectExplorer::Constants::CXX_LANGUAGE_ID);
if (!tc || tc->targetAbi().binaryFormat() == Abi::PEFormat)
return QStringList();
return QStringList() << QLatin1String("-w") << QLatin1String("-r");
return QStringList() << "-w" << "-r";
}
bool MakeStep::fromMap(const QVariantMap &map)
{
m_makeCmd = map.value(QLatin1String(MAKE_COMMAND_KEY)).toString();
m_userArgs = map.value(QLatin1String(MAKE_ARGUMENTS_KEY)).toString();
m_clean = map.value(QLatin1String(CLEAN_KEY)).toBool();
m_makeCmd = map.value(MAKE_COMMAND_KEY).toString();
m_userArgs = map.value(MAKE_ARGUMENTS_KEY).toString();
m_clean = map.value(CLEAN_KEY).toBool();
QStringList oldAddedArgs
= map.value(QLatin1String(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY)).toStringList();
= map.value(AUTOMATICLY_ADDED_MAKE_ARGUMENTS_KEY).toStringList();
foreach (const QString &newArg, automaticallyAddedArguments()) {
if (oldAddedArgs.contains(newArg))
continue;
m_userArgs.prepend(newArg + QLatin1Char(' '));
m_userArgs.prepend(newArg + ' ');
}
return AbstractProcessStep::fromMap(map);
......@@ -199,28 +199,28 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
if (subProFile) {
QString makefile = subProFile->makefile();
if (makefile.isEmpty())
makefile = QLatin1String("Makefile");
makefile = "Makefile";
// Use Makefile.Debug and Makefile.Release
// for file builds, since the rules for that are
// only in those files.
if (subProFile->isDebugAndRelease() && bc->fileNodeBuild()) {
if (bc->buildType() == QmakeBuildConfiguration::Debug)
makefile += QLatin1String(".Debug");
makefile += ".Debug";
else
makefile += QLatin1String(".Release");
makefile += ".Release";
}
if (makefile != QLatin1String("Makefile")) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
if (makefile != "Makefile") {
Utils::QtcProcess::addArg(&args, "-f");
Utils::QtcProcess::addArg(&args, makefile);
}
m_makeFileToCheck = QDir(workingDirectory).filePath(makefile);
} else {
if (!bc->makefile().isEmpty()) {
Utils::QtcProcess::addArg(&args, QLatin1String("-f"));
Utils::QtcProcess::addArg(&args, "-f");
Utils::QtcProcess::addArg(&args, bc->makefile());
m_makeFileToCheck = QDir(workingDirectory).filePath(bc->makefile());
} else {
m_makeFileToCheck = QDir(workingDirectory).filePath(QLatin1String("Makefile"));
m_makeFileToCheck = QDir(workingDirectory).filePath("Makefile");
}
}
......@@ -231,16 +231,16 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
objectsDir = subProFile->buildDir(bc).toString();
if (subProFile->isDebugAndRelease()) {
if (bc->buildType() == QmakeBuildConfiguration::Debug)
objectsDir += QLatin1String("/debug");
objectsDir += "/debug";
else
objectsDir += QLatin1String("/release");
objectsDir += "/release";
}
}
QString relObjectsDir = QDir(pp->workingDirectory()).relativeFilePath(objectsDir);
if (relObjectsDir == QLatin1String("."))
if (relObjectsDir == ".")
relObjectsDir.clear();
if (!relObjectsDir.isEmpty())
relObjectsDir += QLatin1Char('/');
relObjectsDir += '/';
QString objectFile = relObjectsDir +
bc->fileNodeBuild()->filePath().toFileInfo().baseName() +
subProFile->objectExtension();
......@@ -252,8 +252,8 @@ bool MakeStep::init(QList<const BuildStep *> &earlierSteps)
if (tc && makeCommand().isEmpty()) {
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
const QString makeFlags = "MAKEFLAGS";
env.set(makeFlags, 'L' + env.value(makeFlags));
}
}
......@@ -322,7 +322,7 @@ MakeStepConfigWidget::MakeStepConfigWidget(MakeStep *makeStep)
m_ui->makePathChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
m_ui->makePathChooser->setBaseDirectory(Utils::PathChooser::homePath());
m_ui->makePathChooser->setHistoryCompleter(QLatin1String("PE.MakeCommand.History"));
m_ui->makePathChooser->setHistoryCompleter("PE.MakeCommand.History");
const QString &makeCmd = m_makeStep->makeCommand();
m_ui->makePathChooser->setPath(makeCmd);
......@@ -434,8 +434,8 @@ void MakeStepConfigWidget::updateDetails()
if (tc && m_makeStep->makeCommand().isEmpty()) {
if (tc->targetAbi().os() == Abi::WindowsOS
&& tc->targetAbi().osFlavor() != Abi::WindowsMSysFlavor) {
const QString makeFlags = QLatin1String("MAKEFLAGS");
env.set(makeFlags, QLatin1Char('L') + env.value(makeFlags));
const QString makeFlags = "MAKEFLAGS";
env.set(makeFlags, 'L' + env.value(makeFlags));
}
}
param.setArguments(args);
......@@ -502,7 +502,7 @@ BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
MakeStep *step = new MakeStep(parent);
if (parent->id() == ProjectExplorer::Constants::BUILDSTEPS_CLEAN) {
step->setClean(true);
step->setUserArguments(QLatin1String("clean"));
step->setUserArguments("clean");
}
return step;
}
......
......@@ -134,10 +134,10 @@ QString QMakeStep::allArguments(const BaseQtVersion *v, bool shorted) const
arguments << project()->projectFilePath().toUserOutput();
if (v->qtVersion() < QtVersionNumber(5, 0, 0))
arguments << QLatin1String("-r");
arguments << "-r";
bool userProvidedMkspec = false;
for (QtcProcess::ConstArgIterator ait(m_userArgs); ait.next(); ) {
if (ait.value() == QLatin1String("-spec")) {
if (ait.value() == "-spec") {
if (ait.next()) {
userProvidedMkspec = true;
break;
......@@ -146,7 +146,7 @@ QString QMakeStep::allArguments(const BaseQtVersion *v, bool shorted) const
}
FileName specArg = mkspec();
if (!userProvidedMkspec && !specArg.isEmpty())
arguments << QLatin1String("-spec") << specArg.toUserOutput();
arguments << "-spec" << specArg.toUserOutput();
// Find out what flags we pass on to qmake
arguments << bc->configCommandLineArguments();
......@@ -538,7 +538,7 @@ FileName QMakeStep::mkspec() const
QString additionalArguments = m_userArgs;
QtcProcess::addArgs(&additionalArguments, m_extraArgs);
for (QtcProcess::ArgIterator ait(&additionalArguments); ait.next(); ) {
if (ait.value() == QLatin1String("-spec")) {
if (ait.value() == "-spec") {
if (ait.next())
return FileName::fromUserInput(ait.value());
}
......@@ -550,31 +550,31 @@ FileName QMakeStep::mkspec() const
QVariantMap QMakeStep::toMap() const
{
QVariantMap map(AbstractProcessStep::toMap());
map.insert(QLatin1String(QMAKE_ARGUMENTS_KEY), m_userArgs);
map.insert(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), m_linkQmlDebuggingLibrary);
map.insert(QLatin1String(QMAKE_FORCED_KEY), m_forced);
map.insert(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), m_useQtQuickCompiler);
map.insert(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), m_separateDebugInfo);
map.insert(QMAKE_ARGUMENTS_KEY, m_userArgs);
map.insert(QMAKE_QMLDEBUGLIB_KEY, m_linkQmlDebuggingLibrary);
map.insert(QMAKE_FORCED_KEY, m_forced);
map.insert(QMAKE_USE_QTQUICKCOMPILER, m_useQtQuickCompiler);
map.insert(QMAKE_SEPARATEDEBUGINFO_KEY, m_separateDebugInfo);
return map;
}
bool QMakeStep::fromMap(const QVariantMap &map)
{
m_userArgs = map.value(QLatin1String(QMAKE_ARGUMENTS_KEY)).toString();
m_forced = map.value(QLatin1String(QMAKE_FORCED_KEY), false).toBool();
m_useQtQuickCompiler = map.value(QLatin1String(QMAKE_USE_QTQUICKCOMPILER), false).toBool();
m_userArgs = map.value(QMAKE_ARGUMENTS_KEY).toString();
m_forced = map.value(QMAKE_FORCED_KEY, false).toBool();
m_useQtQuickCompiler = map.value(QMAKE_USE_QTQUICKCOMPILER, false).toBool();
// QMAKE_QMLDEBUGLIBAUTO_KEY was used in versions 2.3 to 3.5 (both included) to automatically
// change the qml_debug CONFIG flag based no the qmake build configuration.
if (map.value(QLatin1String(QMAKE_QMLDEBUGLIBAUTO_KEY), false).toBool()) {
if (map.value(QMAKE_QMLDEBUGLIBAUTO_KEY, false).toBool()) {
m_linkQmlDebuggingLibrary =
project()->projectLanguages().contains(
ProjectExplorer::Constants::QMLJS_LANGUAGE_ID) &&
(qmakeBuildConfiguration()->qmakeBuildConfiguration() & BaseQtVersion::DebugBuild);
} else {
m_linkQmlDebuggingLibrary = map.value(QLatin1String(QMAKE_QMLDEBUGLIB_KEY), false).toBool();
m_linkQmlDebuggingLibrary = map.value(QMAKE_QMLDEBUGLIB_KEY, false).toBool();
}
m_separateDebugInfo = map.value(QLatin1String(QMAKE_SEPARATEDEBUGINFO_KEY), false).toBool();
m_separateDebugInfo = map.value(QMAKE_SEPARATEDEBUGINFO_KEY, false).toBool();
return BuildStep::fromMap(map);
}
......@@ -910,7 +910,7 @@ ProjectExplorer::BuildStep *QMakeStepFactory::clone(BuildStepList *parent, Proje
QMakeStepConfig::TargetArchConfig QMakeStepConfig::targetArchFor(const Abi &targetAbi, const BaseQtVersion *version)
{
QMakeStepConfig::TargetArchConfig arch = QMakeStepConfig::NoArch;
if (!version || version->type() != QLatin1String(QtSupport::Constants::DESKTOPQT))
if (!version || version->type() != QtSupport::Constants::DESKTOPQT)
return arch;
if ((targetAbi.os() == ProjectExplorer::Abi::DarwinOS)
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
......@@ -933,7 +933,7 @@ QMakeStepConfig::OsType QMakeStepConfig::osTypeFor(const ProjectExplorer::Abi &t
{
QMakeStepConfig::OsType os = QMakeStepConfig::NoOsType;
const char IOSQT[] = "Qt4ProjectManager.QtVersion.Ios";
if (!version || version->type() != QLatin1String(IOSQT))
if (!version || version->type() != IOSQT)
return os;
if ((targetAbi.os() == ProjectExplorer::Abi::DarwinOS)
&a