forked from qt-creator/qt-creator
Help plugin: Replace foreach with ranged for loop
Change-Id: Idf7a7182e88aba35dff57ef92e1c873b33cb42a1 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -250,7 +250,7 @@ void DocSettingsPageWidget::addDocumentation()
|
|||||||
QSet<QString> values = Utils::toSet(m_filesToUnregister.values(nameSpace));
|
QSet<QString> values = Utils::toSet(m_filesToUnregister.values(nameSpace));
|
||||||
values.remove(filePath);
|
values.remove(filePath);
|
||||||
m_filesToUnregister.remove(nameSpace);
|
m_filesToUnregister.remove(nameSpace);
|
||||||
foreach (const QString &value, values)
|
for (const QString &value : qAsConst(values))
|
||||||
m_filesToUnregister.insert(nameSpace, value);
|
m_filesToUnregister.insert(nameSpace, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -259,7 +259,8 @@ void DocSettingsPageWidget::addDocumentation()
|
|||||||
if (docsUnableToRegister.contains("UnknownNamespace")) {
|
if (docsUnableToRegister.contains("UnknownNamespace")) {
|
||||||
formatedFail += QString::fromLatin1("<ul><li><b>%1</b>")
|
formatedFail += QString::fromLatin1("<ul><li><b>%1</b>")
|
||||||
.arg(Tr::tr("Invalid documentation file:"));
|
.arg(Tr::tr("Invalid documentation file:"));
|
||||||
foreach (const QString &value, docsUnableToRegister.values("UnknownNamespace"))
|
const QStringList values = docsUnableToRegister.values("UnknownNamespace");
|
||||||
|
for (const QString &value : values)
|
||||||
formatedFail += QString::fromLatin1("<ul><li>%2</li></ul>").arg(value);
|
formatedFail += QString::fromLatin1("<ul><li>%2</li></ul>").arg(value);
|
||||||
formatedFail += "</li></ul>";
|
formatedFail += "</li></ul>";
|
||||||
docsUnableToRegister.remove("UnknownNamespace");
|
docsUnableToRegister.remove("UnknownNamespace");
|
||||||
|
@@ -425,7 +425,7 @@ void GeneralSettingsPage::updateFontSizeSelector()
|
|||||||
// try to maintain selection or select closest.
|
// try to maintain selection or select closest.
|
||||||
if (!pointSizes.empty()) {
|
if (!pointSizes.empty()) {
|
||||||
QString n;
|
QString n;
|
||||||
foreach (int pointSize, pointSizes)
|
for (int pointSize : qAsConst(pointSizes))
|
||||||
m_widget->sizeComboBox->addItem(n.setNum(pointSize), QVariant(pointSize));
|
m_widget->sizeComboBox->addItem(n.setNum(pointSize), QVariant(pointSize));
|
||||||
const int closestIndex = closestPointSizeIndex(m_font.pointSize());
|
const int closestIndex = closestPointSizeIndex(m_font.pointSize());
|
||||||
if (closestIndex != -1)
|
if (closestIndex != -1)
|
||||||
@@ -446,7 +446,7 @@ void GeneralSettingsPage::updateFontStyleSelector()
|
|||||||
if (!styles.empty()) {
|
if (!styles.empty()) {
|
||||||
int normalIndex = -1;
|
int normalIndex = -1;
|
||||||
const QString normalStyle = "Normal";
|
const QString normalStyle = "Normal";
|
||||||
foreach (const QString &style, styles) {
|
for (const QString &style : styles) {
|
||||||
// try to maintain selection or select 'normal' preferably
|
// try to maintain selection or select 'normal' preferably
|
||||||
const int newIndex = m_widget->styleComboBox->count();
|
const int newIndex = m_widget->styleComboBox->count();
|
||||||
m_widget->styleComboBox->addItem(style);
|
m_widget->styleComboBox->addItem(style);
|
||||||
|
Reference in New Issue
Block a user