QMake: replace QStringLiteral with QLatin1String
... in string comparisons. It's more efficient. Change-Id: I5d54ab7777a0838455eaaac671e735eb37bfe243 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
This commit is contained in:
parent
acb2e873f0
commit
f384c30979
@ -498,11 +498,11 @@ static QString xcodeFiletypeForFilename(const QString &filename)
|
|||||||
return QStringLiteral("sourcecode.cpp.objcpp");
|
return QStringLiteral("sourcecode.cpp.objcpp");
|
||||||
if (filename.endsWith(Option::objc_ext))
|
if (filename.endsWith(Option::objc_ext))
|
||||||
return QStringLiteral("sourcecode.c.objc");
|
return QStringLiteral("sourcecode.c.objc");
|
||||||
if (filename.endsWith(QStringLiteral(".framework")))
|
if (filename.endsWith(QLatin1String(".framework")))
|
||||||
return QStringLiteral("wrapper.framework");
|
return QStringLiteral("wrapper.framework");
|
||||||
if (filename.endsWith(QStringLiteral(".a")))
|
if (filename.endsWith(QLatin1String(".a")))
|
||||||
return QStringLiteral("archive.ar");
|
return QStringLiteral("archive.ar");
|
||||||
if (filename.endsWith(QStringLiteral(".pro")) || filename.endsWith(QStringLiteral(".qrc")))
|
if (filename.endsWith(QLatin1String(".pro")) || filename.endsWith(QLatin1String(".qrc")))
|
||||||
return QStringLiteral("text");
|
return QStringLiteral("text");
|
||||||
|
|
||||||
return QString();
|
return QString();
|
||||||
|
@ -63,8 +63,8 @@ struct ContainsPathKey
|
|||||||
{
|
{
|
||||||
bool operator()(const QString &val) const
|
bool operator()(const QString &val) const
|
||||||
{
|
{
|
||||||
return !(val.endsWith(QStringLiteral("MSBuildToolsPath"))
|
return !(val.endsWith(QLatin1String("MSBuildToolsPath"))
|
||||||
|| val.endsWith(QStringLiteral("MSBuildToolsRoot")));
|
|| val.endsWith(QLatin1String("MSBuildToolsRoot")));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ bool CeSdkHandler::parseMsBuildFile(QFile *file, CeSdkInfo *info)
|
|||||||
if (success) {
|
if (success) {
|
||||||
const QString startPattern = QStringLiteral("$(Registry:");
|
const QString startPattern = QStringLiteral("$(Registry:");
|
||||||
const int startIndex = sdkRootPath.indexOf(startPattern);
|
const int startIndex = sdkRootPath.indexOf(startPattern);
|
||||||
const int endIndex = sdkRootPath.lastIndexOf(QStringLiteral(")"));
|
const int endIndex = sdkRootPath.lastIndexOf(QLatin1Char(')'));
|
||||||
const QString regString = sdkRootPath.mid(startIndex + startPattern.size(),
|
const QString regString = sdkRootPath.mid(startIndex + startPattern.size(),
|
||||||
endIndex - startIndex - startPattern.size());
|
endIndex - startIndex - startPattern.size());
|
||||||
QSettings sdkRootPathRegistry(regString, QSettings::NativeFormat);
|
QSettings sdkRootPathRegistry(regString, QSettings::NativeFormat);
|
||||||
@ -180,7 +180,7 @@ QStringList CeSdkHandler::filterMsBuildToolPaths(const QStringList &paths) const
|
|||||||
QStringList result;
|
QStringList result;
|
||||||
foreach (const QString &path, paths) {
|
foreach (const QString &path, paths) {
|
||||||
QDir dirVC110(path);
|
QDir dirVC110(path);
|
||||||
if (path.endsWith(QStringLiteral("bin")))
|
if (path.endsWith(QLatin1String("bin")))
|
||||||
dirVC110.cdUp();
|
dirVC110.cdUp();
|
||||||
QDir dirVC120 = dirVC110;
|
QDir dirVC120 = dirVC110;
|
||||||
if (dirVC110.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V110\\Platforms")))
|
if (dirVC110.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V110\\Platforms")))
|
||||||
@ -279,7 +279,7 @@ void CeSdkHandler::retrieveWEC2013SDKs()
|
|||||||
if (cpuInfo.properties.isEmpty())
|
if (cpuInfo.properties.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
const PropertyContainer &cpuInfoVal = cpuInfo.properties.first().properties.value(QLatin1String("CpuName"));
|
const PropertyContainer &cpuInfoVal = cpuInfo.properties.first().properties.value(QLatin1String("CpuName"));
|
||||||
if (cpuInfoVal.name != QStringLiteral("CpuName"))
|
if (cpuInfoVal.name != QLatin1String("CpuName"))
|
||||||
continue;
|
continue;
|
||||||
const QString SDKName = QStringLiteral("SDK name");
|
const QString SDKName = QStringLiteral("SDK name");
|
||||||
currentSdk.m_name = currentProperty.properties.value(SDKName).value+
|
currentSdk.m_name = currentProperty.properties.value(SDKName).value+
|
||||||
|
@ -608,7 +608,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
|
|||||||
|
|
||||||
xml.setIndentString(" ");
|
xml.setIndentString(" ");
|
||||||
|
|
||||||
const QString toolsVersion = (tool.SdkVersion == QStringLiteral("10.0")) ? QStringLiteral("14.0")
|
const QString toolsVersion = (tool.SdkVersion == QLatin1String("10.0")) ? QStringLiteral("14.0")
|
||||||
: QStringLiteral("4.0");
|
: QStringLiteral("4.0");
|
||||||
|
|
||||||
xml << decl("1.0", "utf-8")
|
xml << decl("1.0", "utf-8")
|
||||||
|
@ -110,10 +110,10 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
|
|||||||
QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
|
QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
|
||||||
QString compiler;
|
QString compiler;
|
||||||
QString compilerArch;
|
QString compilerArch;
|
||||||
if (arch == QStringLiteral("arm")) {
|
if (arch == QLatin1String("arm")) {
|
||||||
compiler = QStringLiteral("x86_arm");
|
compiler = QStringLiteral("x86_arm");
|
||||||
compilerArch = QStringLiteral("arm");
|
compilerArch = QStringLiteral("arm");
|
||||||
} else if (arch == QStringLiteral("x64")) {
|
} else if (arch == QLatin1String("x64")) {
|
||||||
const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
|
const ProStringList hostArch = project->values("QMAKE_TARGET.arch");
|
||||||
if (hostArch.contains("x86_64"))
|
if (hostArch.contains("x86_64"))
|
||||||
compiler = QStringLiteral("amd64");
|
compiler = QStringLiteral("amd64");
|
||||||
|
@ -1199,7 +1199,7 @@ void VcprojGenerator::initResourceTool()
|
|||||||
foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
|
foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
|
||||||
QString fixedPath = fileFixify(path.toQString());
|
QString fixedPath = fileFixify(path.toQString());
|
||||||
if (fileInfo(fixedPath).isRelative()) {
|
if (fileInfo(fixedPath).isRelative()) {
|
||||||
if (fixedPath == QStringLiteral("."))
|
if (fixedPath == QLatin1String("."))
|
||||||
fixedPath = QStringLiteral("$(ProjectDir)");
|
fixedPath = QStringLiteral("$(ProjectDir)");
|
||||||
else
|
else
|
||||||
fixedPath.prepend(QStringLiteral("$(ProjectDir)\\"));
|
fixedPath.prepend(QStringLiteral("$(ProjectDir)\\"));
|
||||||
|
@ -957,7 +957,7 @@ static ProString msvcBinDirToQMakeArch(QString subdir)
|
|||||||
if (idx >= 0)
|
if (idx >= 0)
|
||||||
subdir.remove(0, idx + 1);
|
subdir.remove(0, idx + 1);
|
||||||
subdir = subdir.toLower();
|
subdir = subdir.toLower();
|
||||||
if (subdir == QStringLiteral("amd64"))
|
if (subdir == QLatin1String("amd64"))
|
||||||
return ProString("x86_64");
|
return ProString("x86_64");
|
||||||
return ProString(subdir);
|
return ProString(subdir);
|
||||||
}
|
}
|
||||||
|
@ -309,8 +309,8 @@ int runQMake(int argc, char **argv)
|
|||||||
dir = tmp_dir;
|
dir = tmp_dir;
|
||||||
}
|
}
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if (fi.fileName().endsWith(QStringLiteral(".pbxproj"))
|
if (fi.fileName().endsWith(QLatin1String(".pbxproj"))
|
||||||
&& dir.endsWith(QStringLiteral(".xcodeproj")))
|
&& dir.endsWith(QLatin1String(".xcodeproj")))
|
||||||
dir += QStringLiteral("/..");
|
dir += QStringLiteral("/..");
|
||||||
#endif
|
#endif
|
||||||
if(!dir.isNull() && dir != ".")
|
if(!dir.isNull() && dir != ".")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user