Commit 45b6f97c authored by Alexander Lohnau's avatar Alexander Lohnau 💬

Avoid allocating unneeded containers

parent 9293824b
......@@ -568,7 +568,7 @@ void VerifyWizard::onResultPage()
bool VerifyWizard::isSupported(const QString &path)
{
const QFileInfo fileInfo(path);
return fileInfo.isFile() && m_checksumTools.keys().contains(fileInfo.suffix());
return fileInfo.isFile() && m_checksumTools.contains(fileInfo.suffix());
}
} // NAMESPACE CHECKSUM_
......@@ -206,9 +206,9 @@ QLayout *KrLayoutFactory::createLayout(QString layoutName)
}
if(layout) {
foreach(const QString &name, widgets.keys()) {
qWarning() << "widget" << name << "was not added to the layout";
widgets[name]->hide();
for (auto it = widgets.constBegin(), end = widgets.constEnd(); it != end; ++it) {
qWarning() << "widget" << it.key() << "was not added to the layout";
it.value()->hide();
}
} else
qWarning() << "couldn't load layout" << layoutName;
......
......@@ -154,7 +154,7 @@ void ListPanelActions::activePanelChanged()
void ListPanelActions::guiUpdated()
{
QList<QAction*> actions;
foreach(QAction *action, setViewActions.values())
for (QAction *action : qAsConst(setViewActions))
actions << action;
static_cast<KrMainWindow*>(_mainWindow)->plugActionList("view_actionlist", actions);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment