forked from qt-creator/qt-creator
Use Qt 5's QStringList::join(QChar)
Less typing and less cycles than join(QString) where appropriate Change-Id: I6ebc0e17e4d7fd9845864dd95b7de4ba4dad6906 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
This commit is contained in:
@@ -153,7 +153,7 @@ QString Utils::toString(const QList<ProjectFile> &projectFiles)
|
||||
foreach (const ProjectFile &projectFile, projectFiles)
|
||||
filesList << QDir::toNativeSeparators(projectFile.path);
|
||||
::Utils::sort(filesList);
|
||||
return filesList.join(QLatin1String("\n"));
|
||||
return filesList.join(QLatin1Char('\n'));
|
||||
}
|
||||
|
||||
QString Utils::toString(ProjectFile::Kind kind)
|
||||
@@ -412,7 +412,7 @@ QString Utils::pathListToString(const QStringList &pathList)
|
||||
QStringList result;
|
||||
foreach (const QString &path, pathList)
|
||||
result << QDir::toNativeSeparators(path);
|
||||
return result.join(QLatin1String("\n"));
|
||||
return result.join(QLatin1Char('\n'));
|
||||
}
|
||||
|
||||
QString Utils::pathListToString(const ProjectPart::HeaderPaths &pathList)
|
||||
@@ -424,7 +424,7 @@ QString Utils::pathListToString(const ProjectPart::HeaderPaths &pathList)
|
||||
path.isFrameworkPath() ? QLatin1String("framework") : QLatin1String("include")
|
||||
);
|
||||
}
|
||||
return result.join(QLatin1String("\n"));
|
||||
return result.join(QLatin1Char('\n'));
|
||||
}
|
||||
|
||||
QList<CPlusPlus::Document::Ptr> Utils::snapshotToList(const CPlusPlus::Snapshot &snapshot)
|
||||
|
||||
@@ -311,13 +311,14 @@ static inline void setComboText(QComboBox *cb, const QString &text, int defaultI
|
||||
|
||||
void CppFileSettingsWidget::setSettings(const CppFileSettings &s)
|
||||
{
|
||||
const QChar comma = QLatin1Char(',');
|
||||
m_ui->lowerCaseFileNamesCheckBox->setChecked(s.lowerCaseFiles);
|
||||
m_ui->headerPrefixesEdit->setText(s.headerPrefixes.join(QLatin1String(",")));
|
||||
m_ui->sourcePrefixesEdit->setText(s.sourcePrefixes.join(QLatin1String(",")));
|
||||
m_ui->headerPrefixesEdit->setText(s.headerPrefixes.join(comma));
|
||||
m_ui->sourcePrefixesEdit->setText(s.sourcePrefixes.join(comma));
|
||||
setComboText(m_ui->headerSuffixComboBox, s.headerSuffix);
|
||||
setComboText(m_ui->sourceSuffixComboBox, s.sourceSuffix);
|
||||
m_ui->headerSearchPathsEdit->setText(s.headerSearchPaths.join(QLatin1String(",")));
|
||||
m_ui->sourceSearchPathsEdit->setText(s.sourceSearchPaths.join(QLatin1String(",")));
|
||||
m_ui->headerSearchPathsEdit->setText(s.headerSearchPaths.join(comma));
|
||||
m_ui->sourceSearchPathsEdit->setText(s.sourceSearchPaths.join(comma));
|
||||
setLicenseTemplatePath(s.licenseTemplatePath);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user