forked from qt-creator/qt-creator
BuildStep: Do not use QLatin1String/QLatin1Char in BuildSteps
Change-Id: I287831a9151ba867eec443206235c7e07a6176e8 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
@@ -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)
|
||||
&& (targetAbi.binaryFormat() == ProjectExplorer::Abi::MachOFormat)) {
|
||||
@@ -950,29 +950,28 @@ QStringList QMakeStepConfig::toArguments() const
|
||||
{
|
||||
QStringList arguments;
|
||||
if (archConfig == X86)
|
||||
arguments << QLatin1String("CONFIG+=x86");
|
||||
arguments << "CONFIG+=x86";
|
||||
else if (archConfig == X86_64)
|
||||
arguments << QLatin1String("CONFIG+=x86_64");
|
||||
arguments << "CONFIG+=x86_64";
|
||||
else if (archConfig == PowerPC)
|
||||
arguments << QLatin1String("CONFIG+=ppc");
|
||||
arguments << "CONFIG+=ppc";
|
||||
else if (archConfig == PowerPC64)
|
||||
arguments << QLatin1String("CONFIG+=ppc64");
|
||||
arguments << "CONFIG+=ppc64";
|
||||
|
||||
// TODO: make that depend on the actual Qt version that is used
|
||||
if (osType == IphoneSimulator)
|
||||
arguments << QLatin1String("CONFIG+=iphonesimulator") << QLatin1String("CONFIG+=simulator") /*since Qt 5.7*/;
|
||||
arguments << "CONFIG+=iphonesimulator" << "CONFIG+=simulator" /*since Qt 5.7*/;
|
||||
else if (osType == IphoneOS)
|
||||
arguments << QLatin1String("CONFIG+=iphoneos") << QLatin1String("CONFIG+=device") /*since Qt 5.7*/;
|
||||
arguments << "CONFIG+=iphoneos" << "CONFIG+=device" /*since Qt 5.7*/;
|
||||
|
||||
if (linkQmlDebuggingQQ2)
|
||||
arguments << QLatin1String("CONFIG+=qml_debug");
|
||||
arguments << "CONFIG+=qml_debug";
|
||||
|
||||
if (useQtQuickCompiler)
|
||||
arguments << QLatin1String("CONFIG+=qtquickcompiler");
|
||||
arguments << "CONFIG+=qtquickcompiler";
|
||||
|
||||
if (separateDebugInfo)
|
||||
arguments << QLatin1String("CONFIG+=force_debug_info")
|
||||
<< QLatin1String("CONFIG+=separate_debug_info");
|
||||
arguments << "CONFIG+=force_debug_info" << "CONFIG+=separate_debug_info";
|
||||
|
||||
return arguments;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user