summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrius Štikonas <andrius@stikonas.eu>2016-09-01 12:53:59 (GMT)
committerAndrius Štikonas <andrius@stikonas.eu>2016-09-01 12:53:59 (GMT)
commitd4aa0fc394a6bdefceb841b1edab67e2175b3501 (patch)
tree58535ee9eeb2a92d86af3d5408f780f392ccbc73
parentd03cbf12373d900bee73b1b62276cf576a9eedf0 (diff)
Q_FOREACH -> C++11 for.
-rw-r--r--src/settings.cpp4
-rw-r--r--src/toplevel.cpp3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/settings.cpp b/src/settings.cpp
index e1eb25d..50f316b 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -183,9 +183,9 @@ void SettingsDialog::newButtonClicked()
void SettingsDialog::removeButtonClicked()
{
- QModelIndexList indexes = ui->tealistTreeView->selectionModel()->selectedIndexes();
+ const QModelIndexList indexes = ui->tealistTreeView->selectionModel()->selectedIndexes();
- foreach(const QModelIndex &index, indexes) {
+ for (const QModelIndex &index : indexes) {
// Only delete a row when column==0, otherwise the row will be delete
// multiple times (the loop iterate over every cell, not over rows).
if( index.column() == 0 ) {
diff --git a/src/toplevel.cpp b/src/toplevel.cpp
index dc102c3..80d7167 100644
--- a/src/toplevel.cpp
+++ b/src/toplevel.cpp
@@ -160,7 +160,8 @@ void TopLevel::setTeaList(const QList<Tea> &tealist) {
tealistGroup.config()->sync();
- foreach(QAction* a, m_teaActionGroup->actions() ) {
+ const auto actions = m_teaActionGroup->actions();
+ for ( QAction* a : actions ) {
m_teaActionGroup->removeAction( a );
}