forked from qt-creator/qt-creator
Reduce usage of QStringRef::toString() in project manager/cmake.
Change-Id: I5d60c663d8a258334dde9b93b4f76a4bea760a70 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
@@ -969,7 +969,7 @@ void CMakeCbpParser::parseBuildTargetOption()
|
||||
if (attributes().hasAttribute(QLatin1String("output"))) {
|
||||
m_buildTarget.executable = attributes().value(QLatin1String("output")).toString();
|
||||
} else if (attributes().hasAttribute(QLatin1String("type"))) {
|
||||
const QString value = attributes().value(QLatin1String("type")).toString();
|
||||
const QStringRef value = attributes().value(QLatin1String("type"));
|
||||
if (value == QLatin1String("2") || value == QLatin1String("3"))
|
||||
m_buildTarget.library = true;
|
||||
} else if (attributes().hasAttribute(QLatin1String("working_dir"))) {
|
||||
|
@@ -503,7 +503,7 @@ static inline FeatureSet requiredFeatures(const QXmlStreamReader &reader)
|
||||
static inline IWizard::WizardFlags wizardFlags(const QXmlStreamReader &reader)
|
||||
{
|
||||
IWizard::WizardFlags flags;
|
||||
QString value = reader.attributes().value(QLatin1String(platformIndependentC)).toString();
|
||||
const QStringRef value = reader.attributes().value(QLatin1String(platformIndependentC));
|
||||
|
||||
if (!value.isEmpty() && value == QLatin1String("true"))
|
||||
flags |= IWizard::PlatformIndependent;
|
||||
@@ -530,14 +530,14 @@ static inline bool booleanAttributeValue(const QXmlStreamReader &r, const char *
|
||||
|
||||
static inline int integerAttributeValue(const QXmlStreamReader &r, const char *name, int defaultValue)
|
||||
{
|
||||
const QString sValue = r.attributes().value(QLatin1String(name)).toString();
|
||||
const QStringRef sValue = r.attributes().value(QLatin1String(name));
|
||||
if (sValue.isEmpty())
|
||||
return defaultValue;
|
||||
bool ok;
|
||||
const int value = sValue.toInt(&ok);
|
||||
const int value = sValue.toString().toInt(&ok);
|
||||
if (!ok) {
|
||||
qWarning("Invalid integer value specification '%s' for attribute '%s'.",
|
||||
qPrintable(sValue), name);
|
||||
qPrintable(sValue.toString()), name);
|
||||
return defaultValue;
|
||||
}
|
||||
return value;
|
||||
|
Reference in New Issue
Block a user