Port away from foreach

parent ef4f8a8f
......@@ -523,8 +523,8 @@ KFileLVI::KFileLVI(QTreeWidget* parent, DiffModel* model) : QTreeWidgetItem(pare
bool KFileLVI::hasExtension(const QString& extensions, const QString& fileName)
{
QStringList extList = extensions.split(QLatin1Char(' '));
foreach (const QString& ext, extList) {
const QStringList extList = extensions.split(QLatin1Char(' '));
for (const QString& ext : extList) {
if (fileName.endsWith(ext, Qt::CaseInsensitive)) {
return true;
}
......
......@@ -92,8 +92,8 @@ KomparePart::KomparePart(QWidget* parentWidget, QObject* parent, const KAboutDat
// This creates the "Model creator" and connects the signals and slots
m_modelList = new Diff2::KompareModelList(m_diffSettings, m_splitter, this, "komparemodellist" , (modus == ReadWriteModus));
Q_FOREACH (QAction* action, m_modelList->actionCollection()->actions())
{
const auto modelListActions = m_modelList->actionCollection()->actions();
for (QAction* action : modelListActions) {
actionCollection()->addAction(action->objectName(), action);
}
connect(m_modelList, &KompareModelList::status,
......
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