forked from qt-creator/qt-creator
CorePlugin: Remove foreach / Q_FOREACH usage
Task-number: QTCREATORBUG-27464 Change-Id: I0d0257bbd46f3eec9b11b386d1987156e83a9dac Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -351,7 +351,7 @@ Command *ActionContainerPrivate::addSeparator(const Context &context, Id group,
|
|||||||
void ActionContainerPrivate::clear()
|
void ActionContainerPrivate::clear()
|
||||||
{
|
{
|
||||||
for (Group &group : m_groups) {
|
for (Group &group : m_groups) {
|
||||||
foreach (QObject *item, group.items) {
|
for (QObject *item : qAsConst(group.items)) {
|
||||||
if (auto command = qobject_cast<Command *>(item)) {
|
if (auto command = qobject_cast<Command *>(item)) {
|
||||||
removeAction(command);
|
removeAction(command);
|
||||||
disconnect(command, &Command::activeStateChanged,
|
disconnect(command, &Command::activeStateChanged,
|
||||||
@@ -482,7 +482,7 @@ bool MenuActionContainer::updateInternal()
|
|||||||
QList<QAction *> actions = m_menu->actions();
|
QList<QAction *> actions = m_menu->actions();
|
||||||
|
|
||||||
for (const Group &group : qAsConst(m_groups)) {
|
for (const Group &group : qAsConst(m_groups)) {
|
||||||
foreach (QObject *item, group.items) {
|
for (QObject *item : qAsConst(group.items)) {
|
||||||
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
if (auto container = qobject_cast<ActionContainerPrivate*>(item)) {
|
||||||
actions.removeAll(container->menu()->menuAction());
|
actions.removeAll(container->menu()->menuAction());
|
||||||
if (container == this) {
|
if (container == this) {
|
||||||
@@ -512,7 +512,7 @@ bool MenuActionContainer::updateInternal()
|
|||||||
}
|
}
|
||||||
if (!hasitems) {
|
if (!hasitems) {
|
||||||
// look if there were actions added that we don't control and check if they are enabled
|
// look if there were actions added that we don't control and check if they are enabled
|
||||||
foreach (const QAction *action, actions) {
|
for (const QAction *action : qAsConst(actions)) {
|
||||||
if (!action->isSeparator() && action->isEnabled()) {
|
if (!action->isSeparator() && action->isEnabled()) {
|
||||||
hasitems = true;
|
hasitems = true;
|
||||||
break;
|
break;
|
||||||
|
@@ -303,7 +303,7 @@ QList<Command *> ActionManager::commands()
|
|||||||
{
|
{
|
||||||
// transform list of Action into list of Command
|
// transform list of Action into list of Command
|
||||||
QList<Command *> result;
|
QList<Command *> result;
|
||||||
foreach (Command *cmd, d->m_idCmdMap)
|
for (Command *cmd : qAsConst(d->m_idCmdMap))
|
||||||
result << cmd;
|
result << cmd;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -346,7 +346,8 @@ void ActionManager::setPresentationModeEnabled(bool enabled)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Signal/slots to commands:
|
// Signal/slots to commands:
|
||||||
foreach (Command *c, commands()) {
|
const QList<Command *> commandList = commands();
|
||||||
|
for (Command *c : commandList) {
|
||||||
if (c->action()) {
|
if (c->action()) {
|
||||||
if (enabled)
|
if (enabled)
|
||||||
connect(c->action(), &QAction::triggered, d, &ActionManagerPrivate::actionTriggered);
|
connect(c->action(), &QAction::triggered, d, &ActionManagerPrivate::actionTriggered);
|
||||||
@@ -406,7 +407,7 @@ void ActionManager::setContext(const Context &context)
|
|||||||
ActionManagerPrivate::~ActionManagerPrivate()
|
ActionManagerPrivate::~ActionManagerPrivate()
|
||||||
{
|
{
|
||||||
// first delete containers to avoid them reacting to command deletion
|
// first delete containers to avoid them reacting to command deletion
|
||||||
foreach (ActionContainerPrivate *container, m_idContainerMap)
|
for (const ActionContainerPrivate *container : qAsConst(m_idContainerMap))
|
||||||
disconnect(container, &QObject::destroyed, this, &ActionManagerPrivate::containerDestroyed);
|
disconnect(container, &QObject::destroyed, this, &ActionManagerPrivate::containerDestroyed);
|
||||||
qDeleteAll(m_idContainerMap);
|
qDeleteAll(m_idContainerMap);
|
||||||
qDeleteAll(m_idCmdMap);
|
qDeleteAll(m_idCmdMap);
|
||||||
|
@@ -131,7 +131,7 @@ bool CommandsFile::exportCommands(const QList<ShortcutItem *> &items)
|
|||||||
arg(ICore::versionString(),
|
arg(ICore::versionString(),
|
||||||
QDateTime::currentDateTime().toString(Qt::ISODate)));
|
QDateTime::currentDateTime().toString(Qt::ISODate)));
|
||||||
w.writeStartElement(ctx.mappingElement);
|
w.writeStartElement(ctx.mappingElement);
|
||||||
foreach (const ShortcutItem *item, items) {
|
for (const ShortcutItem *item : qAsConst(items)) {
|
||||||
const Id id = item->m_cmd->id();
|
const Id id = item->m_cmd->id();
|
||||||
if (item->m_keys.isEmpty() || item->m_keys.first().isEmpty()) {
|
if (item->m_keys.isEmpty() || item->m_keys.first().isEmpty()) {
|
||||||
w.writeEmptyElement(ctx.shortCutElement);
|
w.writeEmptyElement(ctx.shortCutElement);
|
||||||
|
@@ -152,7 +152,7 @@ bool BaseFileWizardFactory::writeFiles(const GeneratedFiles &files, QString *err
|
|||||||
{
|
{
|
||||||
const GeneratedFile::Attributes noWriteAttributes
|
const GeneratedFile::Attributes noWriteAttributes
|
||||||
= GeneratedFile::CustomGeneratorAttribute|GeneratedFile::KeepExistingFileAttribute;
|
= GeneratedFile::CustomGeneratorAttribute|GeneratedFile::KeepExistingFileAttribute;
|
||||||
foreach (const GeneratedFile &generatedFile, files)
|
for (const GeneratedFile &generatedFile : qAsConst(files))
|
||||||
if (!(generatedFile.attributes() & noWriteAttributes ))
|
if (!(generatedFile.attributes() & noWriteAttributes ))
|
||||||
if (!generatedFile.write(errorMessage))
|
if (!generatedFile.write(errorMessage))
|
||||||
return false;
|
return false;
|
||||||
@@ -186,7 +186,7 @@ bool BaseFileWizardFactory::postGenerateFiles(const QWizard *, const GeneratedFi
|
|||||||
|
|
||||||
bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage)
|
bool BaseFileWizardFactory::postGenerateOpenEditors(const GeneratedFiles &l, QString *errorMessage)
|
||||||
{
|
{
|
||||||
foreach (const GeneratedFile &file, l) {
|
for (const GeneratedFile &file : qAsConst(l)) {
|
||||||
if (file.attributes() & GeneratedFile::OpenEditorAttribute) {
|
if (file.attributes() & GeneratedFile::OpenEditorAttribute) {
|
||||||
if (!EditorManager::openEditor(FilePath::fromString(file.path()), file.editorId())) {
|
if (!EditorManager::openEditor(FilePath::fromString(file.path()), file.editorId())) {
|
||||||
if (errorMessage)
|
if (errorMessage)
|
||||||
@@ -218,7 +218,7 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
|
|||||||
static const QString directoryMsg = tr("[folder]");
|
static const QString directoryMsg = tr("[folder]");
|
||||||
static const QString symLinkMsg = tr("[symbolic link]");
|
static const QString symLinkMsg = tr("[symbolic link]");
|
||||||
|
|
||||||
foreach (const GeneratedFile &file, *files) {
|
for (const GeneratedFile &file : qAsConst(*files)) {
|
||||||
const QString path = file.path();
|
const QString path = file.path();
|
||||||
if (QFileInfo::exists(path))
|
if (QFileInfo::exists(path))
|
||||||
existingFiles.append(path);
|
existingFiles.append(path);
|
||||||
@@ -230,7 +230,7 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
|
|||||||
// Format a file list message as ( "<file1> [readonly], <file2> [folder]").
|
// Format a file list message as ( "<file1> [readonly], <file2> [folder]").
|
||||||
const QString commonExistingPath = Utils::commonPath(existingFiles);
|
const QString commonExistingPath = Utils::commonPath(existingFiles);
|
||||||
QString fileNamesMsgPart;
|
QString fileNamesMsgPart;
|
||||||
foreach (const QString &fileName, existingFiles) {
|
for (const QString &fileName : qAsConst(existingFiles)) {
|
||||||
const QFileInfo fi(fileName);
|
const QFileInfo fi(fileName);
|
||||||
if (fi.exists()) {
|
if (fi.exists()) {
|
||||||
if (!fileNamesMsgPart.isEmpty())
|
if (!fileNamesMsgPart.isEmpty())
|
||||||
@@ -264,7 +264,7 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
|
|||||||
PromptOverwriteDialog overwriteDialog;
|
PromptOverwriteDialog overwriteDialog;
|
||||||
// Scripts cannot handle overwrite
|
// Scripts cannot handle overwrite
|
||||||
overwriteDialog.setFiles(existingFiles);
|
overwriteDialog.setFiles(existingFiles);
|
||||||
foreach (const GeneratedFile &file, *files)
|
for (const GeneratedFile &file : qAsConst(*files))
|
||||||
if (file.attributes() & GeneratedFile::CustomGeneratorAttribute)
|
if (file.attributes() & GeneratedFile::CustomGeneratorAttribute)
|
||||||
overwriteDialog.setFileEnabled(file.path(), false);
|
overwriteDialog.setFileEnabled(file.path(), false);
|
||||||
if (overwriteDialog.exec() != QDialog::Accepted)
|
if (overwriteDialog.exec() != QDialog::Accepted)
|
||||||
@@ -273,7 +273,7 @@ BaseFileWizardFactory::OverwriteResult BaseFileWizardFactory::promptOverwrite(Ge
|
|||||||
if (existingFilesToKeep.size() == files->size()) // All exist & all unchecked->Cancel.
|
if (existingFilesToKeep.size() == files->size()) // All exist & all unchecked->Cancel.
|
||||||
return OverwriteCanceled;
|
return OverwriteCanceled;
|
||||||
// Set 'keep' attribute in files
|
// Set 'keep' attribute in files
|
||||||
foreach (const QString &keepFile, existingFilesToKeep) {
|
for (const QString &keepFile : qAsConst(existingFilesToKeep)) {
|
||||||
const int i = indexOfFile(*files, keepFile);
|
const int i = indexOfFile(*files, keepFile);
|
||||||
QTC_ASSERT(i != -1, return OverwriteCanceled);
|
QTC_ASSERT(i != -1, return OverwriteCanceled);
|
||||||
GeneratedFile &file = (*files)[i];
|
GeneratedFile &file = (*files)[i];
|
||||||
|
@@ -140,7 +140,7 @@ void DesignMode::registerDesignWidget(QWidget *widget,
|
|||||||
void DesignMode::unregisterDesignWidget(QWidget *widget)
|
void DesignMode::unregisterDesignWidget(QWidget *widget)
|
||||||
{
|
{
|
||||||
d->m_stackWidget->removeWidget(widget);
|
d->m_stackWidget->removeWidget(widget);
|
||||||
foreach (DesignEditorInfo *info, d->m_editors) {
|
for (DesignEditorInfo *info : qAsConst(d->m_editors)) {
|
||||||
if (info->widget == widget) {
|
if (info->widget == widget) {
|
||||||
d->m_editors.removeAll(info);
|
d->m_editors.removeAll(info);
|
||||||
delete info;
|
delete info;
|
||||||
|
@@ -77,15 +77,15 @@ CodecSelector::CodecSelector(QWidget *parent, Core::BaseTextDocument *doc)
|
|||||||
QList<int> mibs = QTextCodec::availableMibs();
|
QList<int> mibs = QTextCodec::availableMibs();
|
||||||
Utils::sort(mibs);
|
Utils::sort(mibs);
|
||||||
QList<int> sortedMibs;
|
QList<int> sortedMibs;
|
||||||
foreach (int mib, mibs)
|
for (const int mib : qAsConst(mibs))
|
||||||
if (mib >= 0)
|
if (mib >= 0)
|
||||||
sortedMibs += mib;
|
sortedMibs += mib;
|
||||||
foreach (int mib, mibs)
|
for (const int mib : qAsConst(mibs))
|
||||||
if (mib < 0)
|
if (mib < 0)
|
||||||
sortedMibs += mib;
|
sortedMibs += mib;
|
||||||
|
|
||||||
int currentIndex = -1;
|
int currentIndex = -1;
|
||||||
foreach (int mib, sortedMibs) {
|
for (const int mib : qAsConst(sortedMibs)) {
|
||||||
QTextCodec *c = QTextCodec::codecForMib(mib);
|
QTextCodec *c = QTextCodec::codecForMib(mib);
|
||||||
if (!doc->supportsCodec(c))
|
if (!doc->supportsCodec(c))
|
||||||
continue;
|
continue;
|
||||||
@@ -101,7 +101,8 @@ CodecSelector::CodecSelector(QWidget *parent, Core::BaseTextDocument *doc)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
QString names = QString::fromLatin1(c->name());
|
QString names = QString::fromLatin1(c->name());
|
||||||
foreach (const QByteArray &alias, c->aliases())
|
const QList<QByteArray> aliases = c->aliases();
|
||||||
|
for (const QByteArray &alias : aliases)
|
||||||
names += QLatin1String(" / ") + QString::fromLatin1(alias);
|
names += QLatin1String(" / ") + QString::fromLatin1(alias);
|
||||||
if (doc->codec() == c)
|
if (doc->codec() == c)
|
||||||
currentIndex = encodings.count();
|
currentIndex = encodings.count();
|
||||||
|
@@ -351,7 +351,7 @@ void MimeTypeSettingsPrivate::syncData(const QModelIndex ¤t,
|
|||||||
: Utils::magicRulesForMimeType(currentMimeType);
|
: Utils::magicRulesForMimeType(currentMimeType);
|
||||||
for (auto it = rules.constBegin(); it != rules.constEnd(); ++it) {
|
for (auto it = rules.constBegin(); it != rules.constEnd(); ++it) {
|
||||||
int priority = it.key();
|
int priority = it.key();
|
||||||
foreach (const Utils::MimeMagicRule &rule, it.value()) {
|
for (const Utils::MimeMagicRule &rule : it.value()) {
|
||||||
addMagicHeaderRow(MagicData(rule, priority));
|
addMagicHeaderRow(MagicData(rule, priority));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -515,14 +515,14 @@ void MimeTypeSettingsPrivate::writeUserModifiedMimeTypes()
|
|||||||
writer.writeStartDocument();
|
writer.writeStartDocument();
|
||||||
writer.writeStartElement(QLatin1String(mimeInfoTagC));
|
writer.writeStartElement(QLatin1String(mimeInfoTagC));
|
||||||
|
|
||||||
foreach (const UserMimeType &mt, m_userModifiedMimeTypes) {
|
for (const UserMimeType &mt : qAsConst(m_userModifiedMimeTypes)) {
|
||||||
writer.writeStartElement(QLatin1String(mimeTypeTagC));
|
writer.writeStartElement(QLatin1String(mimeTypeTagC));
|
||||||
writer.writeAttribute(QLatin1String(mimeTypeAttributeC), mt.name);
|
writer.writeAttribute(QLatin1String(mimeTypeAttributeC), mt.name);
|
||||||
writer.writeAttribute(QLatin1String(patternAttributeC),
|
writer.writeAttribute(QLatin1String(patternAttributeC),
|
||||||
mt.globPatterns.join(kSemiColon));
|
mt.globPatterns.join(kSemiColon));
|
||||||
for (auto prioIt = mt.rules.constBegin(); prioIt != mt.rules.constEnd(); ++prioIt) {
|
for (auto prioIt = mt.rules.constBegin(); prioIt != mt.rules.constEnd(); ++prioIt) {
|
||||||
const QString priorityString = QString::number(prioIt.key());
|
const QString priorityString = QString::number(prioIt.key());
|
||||||
foreach (const Utils::MimeMagicRule &rule, prioIt.value()) {
|
for (const Utils::MimeMagicRule &rule : prioIt.value()) {
|
||||||
writer.writeStartElement(QLatin1String(matchTagC));
|
writer.writeStartElement(QLatin1String(matchTagC));
|
||||||
writer.writeAttribute(QLatin1String(matchValueAttributeC),
|
writer.writeAttribute(QLatin1String(matchValueAttributeC),
|
||||||
QString::fromUtf8(rule.value()));
|
QString::fromUtf8(rule.value()));
|
||||||
|
@@ -301,7 +301,7 @@ void ModeManager::addAction(QAction *action, int priority)
|
|||||||
|
|
||||||
// Count the number of commands with a higher priority
|
// Count the number of commands with a higher priority
|
||||||
int index = 0;
|
int index = 0;
|
||||||
foreach (int p, d->m_actions) {
|
for (int p : qAsConst(d->m_actions)) {
|
||||||
if (p > priority)
|
if (p > priority)
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
@@ -113,7 +113,7 @@ void NavigationSubWidget::comboBoxIndexChanged(int factoryIndex)
|
|||||||
saveSettings();
|
saveSettings();
|
||||||
|
|
||||||
// Remove toolbutton
|
// Remove toolbutton
|
||||||
foreach (QWidget *w, m_additionalToolBarWidgets)
|
for (QWidget *w : qAsConst(m_additionalToolBarWidgets))
|
||||||
delete w;
|
delete w;
|
||||||
m_additionalToolBarWidgets.clear();
|
m_additionalToolBarWidgets.clear();
|
||||||
|
|
||||||
@@ -134,9 +134,8 @@ void NavigationSubWidget::comboBoxIndexChanged(int factoryIndex)
|
|||||||
// Add Toolbutton
|
// Add Toolbutton
|
||||||
m_additionalToolBarWidgets = n.dockToolBarWidgets;
|
m_additionalToolBarWidgets = n.dockToolBarWidgets;
|
||||||
auto layout = qobject_cast<QHBoxLayout *>(m_toolBar->layout());
|
auto layout = qobject_cast<QHBoxLayout *>(m_toolBar->layout());
|
||||||
foreach (QToolButton *w, m_additionalToolBarWidgets) {
|
for (QToolButton *w : qAsConst(m_additionalToolBarWidgets))
|
||||||
layout->insertWidget(layout->count()-2, w);
|
layout->insertWidget(layout->count()-2, w);
|
||||||
}
|
|
||||||
|
|
||||||
restoreSettings();
|
restoreSettings();
|
||||||
emit factoryIndexChanged(factoryIndex);
|
emit factoryIndexChanged(factoryIndex);
|
||||||
|
@@ -244,7 +244,7 @@ QWidget *NavigationWidget::activateSubWidget(Id factoryId, Side fallbackSide)
|
|||||||
void NavigationWidget::setFactories(const QList<INavigationWidgetFactory *> &factories)
|
void NavigationWidget::setFactories(const QList<INavigationWidgetFactory *> &factories)
|
||||||
{
|
{
|
||||||
Context navicontext(Constants::C_NAVIGATION_PANE);
|
Context navicontext(Constants::C_NAVIGATION_PANE);
|
||||||
foreach (INavigationWidgetFactory *factory, factories) {
|
for (INavigationWidgetFactory *factory : qAsConst(factories)) {
|
||||||
const Id id = factory->id();
|
const Id id = factory->id();
|
||||||
const Id actionId = id.withPrefix("QtCreator.Sidebar.");
|
const Id actionId = id.withPrefix("QtCreator.Sidebar.");
|
||||||
|
|
||||||
@@ -349,7 +349,7 @@ Internal::NavigationSubWidget *NavigationWidget::insertSubItem(int position, int
|
|||||||
QWidget *NavigationWidget::activateSubWidget(Id factoryId, int preferredPosition)
|
QWidget *NavigationWidget::activateSubWidget(Id factoryId, int preferredPosition)
|
||||||
{
|
{
|
||||||
setShown(true);
|
setShown(true);
|
||||||
foreach (Internal::NavigationSubWidget *subWidget, d->m_subWidgets) {
|
for (Internal::NavigationSubWidget *subWidget : qAsConst(d->m_subWidgets)) {
|
||||||
if (subWidget->factory()->id() == factoryId) {
|
if (subWidget->factory()->id() == factoryId) {
|
||||||
subWidget->setFocusWidget();
|
subWidget->setFocusWidget();
|
||||||
ICore::raiseWindow(this);
|
ICore::raiseWindow(this);
|
||||||
@@ -457,7 +457,7 @@ void NavigationWidget::restoreSettings(QSettings *settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int position = 0;
|
int position = 0;
|
||||||
foreach (const QString &id, viewIds) {
|
for (const QString &id : qAsConst(viewIds)) {
|
||||||
int index = factoryIndex(Id::fromString(id));
|
int index = factoryIndex(Id::fromString(id));
|
||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
// Only add if the id was actually found!
|
// Only add if the id was actually found!
|
||||||
@@ -509,7 +509,7 @@ void NavigationWidget::restoreSettings(QSettings *settings)
|
|||||||
|
|
||||||
void NavigationWidget::closeSubWidgets()
|
void NavigationWidget::closeSubWidgets()
|
||||||
{
|
{
|
||||||
foreach (Internal::NavigationSubWidget *subWidget, d->m_subWidgets) {
|
for (Internal::NavigationSubWidget *subWidget : qAsConst(d->m_subWidgets)) {
|
||||||
subWidget->saveSettings();
|
subWidget->saveSettings();
|
||||||
delete subWidget;
|
delete subWidget;
|
||||||
}
|
}
|
||||||
|
@@ -126,7 +126,7 @@ void OutputPanePlaceHolder::setMaximized(bool maximize)
|
|||||||
if (maximize) {
|
if (maximize) {
|
||||||
d->m_nonMaximizedSize = sizes[idx];
|
d->m_nonMaximizedSize = sizes[idx];
|
||||||
int sum = 0;
|
int sum = 0;
|
||||||
foreach (int s, sizes)
|
for (const int s : qAsConst(sizes))
|
||||||
sum += s;
|
sum += s;
|
||||||
for (int i = 0; i < sizes.count(); ++i) {
|
for (int i = 0; i < sizes.count(); ++i) {
|
||||||
sizes[i] = 32;
|
sizes[i] = 32;
|
||||||
|
@@ -473,7 +473,8 @@ void OutputPaneManager::initialize()
|
|||||||
auto toolButtonsLayout = new QHBoxLayout;
|
auto toolButtonsLayout = new QHBoxLayout;
|
||||||
toolButtonsLayout->setContentsMargins(0, 0, 0, 0);
|
toolButtonsLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
toolButtonsLayout->setSpacing(0);
|
toolButtonsLayout->setSpacing(0);
|
||||||
foreach (QWidget *toolButton, outPane->toolBarWidgets())
|
const QList<QWidget *> toolBarWidgets = outPane->toolBarWidgets();
|
||||||
|
for (QWidget *toolButton : toolBarWidgets)
|
||||||
toolButtonsLayout->addWidget(toolButton);
|
toolButtonsLayout->addWidget(toolButton);
|
||||||
toolButtonsLayout->addStretch(5);
|
toolButtonsLayout->addStretch(5);
|
||||||
toolButtonsContainer->setLayout(toolButtonsLayout);
|
toolButtonsContainer->setLayout(toolButtonsLayout);
|
||||||
|
@@ -510,7 +510,7 @@ void ProgressManagerPrivate::stopFadeOfSummaryProgress()
|
|||||||
|
|
||||||
bool ProgressManagerPrivate::hasError() const
|
bool ProgressManagerPrivate::hasError() const
|
||||||
{
|
{
|
||||||
foreach (FutureProgress *progress, m_taskList)
|
for (const FutureProgress *progress : qAsConst(m_taskList))
|
||||||
if (progress->hasError())
|
if (progress->hasError())
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
@@ -520,7 +520,7 @@ bool ProgressManagerPrivate::isLastFading() const
|
|||||||
{
|
{
|
||||||
if (m_taskList.isEmpty())
|
if (m_taskList.isEmpty())
|
||||||
return false;
|
return false;
|
||||||
foreach (FutureProgress *progress, m_taskList) {
|
for (const FutureProgress *progress : qAsConst(m_taskList)) {
|
||||||
if (!progress->isFading()) // we still have progress bars that are not fading
|
if (!progress->isFading()) // we still have progress bars that are not fading
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -571,7 +571,7 @@ void ProgressManagerPrivate::removeOneOldTask()
|
|||||||
Id type = (*i)->type();
|
Id type = (*i)->type();
|
||||||
|
|
||||||
int taskCount = 0;
|
int taskCount = 0;
|
||||||
foreach (FutureProgress *p, m_taskList)
|
for (const FutureProgress *p : qAsConst(m_taskList))
|
||||||
if (p->type() == type)
|
if (p->type() == type)
|
||||||
++taskCount;
|
++taskCount;
|
||||||
|
|
||||||
|
@@ -217,7 +217,8 @@ void SettingsDatabase::remove(const QString &key)
|
|||||||
const QString effectiveKey = d->effectiveKey(key);
|
const QString effectiveKey = d->effectiveKey(key);
|
||||||
|
|
||||||
// Remove keys from the cache
|
// Remove keys from the cache
|
||||||
foreach (const QString &k, d->m_settings.keys()) {
|
const QStringList keys = d->m_settings.keys();
|
||||||
|
for (const QString &k : keys) {
|
||||||
// Either it's an exact match, or it matches up to a /
|
// Either it's an exact match, or it matches up to a /
|
||||||
if (k.startsWith(effectiveKey)
|
if (k.startsWith(effectiveKey)
|
||||||
&& (k.length() == effectiveKey.length()
|
&& (k.length() == effectiveKey.length()
|
||||||
|
Reference in New Issue
Block a user