Convert all foreach() to range-based for()

This commit is contained in:
thalieht 2018-11-18 20:40:37 +02:00
parent d668a4fe6d
commit 6b1d26d555
64 changed files with 326 additions and 292 deletions

View file

@ -143,7 +143,7 @@ AddNewTorrentDialog::AddNewTorrentDialog(const BitTorrent::AddTorrentParams &inP
m_ui->categoryComboBox->addItem(defaultCategory);
m_ui->categoryComboBox->addItem("");
foreach (const QString &category, categories)
for (const QString &category : qAsConst(categories))
if (category != defaultCategory && category != m_torrentParams.category)
m_ui->categoryComboBox->addItem(category);
@ -631,7 +631,7 @@ void AddNewTorrentDialog::displayContentTreeMenu(const QPoint &)
prio = prio::IGNORED;
qDebug("Setting files priority");
foreach (const QModelIndex &index, selectedRows) {
for (const QModelIndex &index : selectedRows) {
qDebug("Setting priority(%d) for file at row %d", prio, index.row());
m_contentModel->setData(m_contentModel->index(index.row(), PRIORITY, index.parent()), prio);
}