Convert Q_FOREACH loops to C++11 for loops.

Q_FOREACH will de deprecated soon.
This commit is contained in:
Felix Geyer 2016-09-02 19:51:51 +02:00 committed by Jonathan White
parent ad834f0f58
commit fff9e7ac46
31 changed files with 202 additions and 143 deletions

View file

@ -323,7 +323,7 @@ void DatabaseWidget::deleteEntries()
// get all entry pointers as the indexes change when removing multiple entries
QList<Entry*> selectedEntries;
Q_FOREACH (const QModelIndex& index, selected) {
for (const QModelIndex& index : selected) {
selectedEntries.append(m_entryView->entryFromIndex(index));
}
@ -347,7 +347,7 @@ void DatabaseWidget::deleteEntries()
}
if (result == QMessageBox::Yes) {
Q_FOREACH (Entry* entry, selectedEntries) {
for (Entry* entry : asConst(selectedEntries)) {
delete entry;
}
}
@ -373,7 +373,7 @@ void DatabaseWidget::deleteEntries()
return;
}
Q_FOREACH (Entry* entry, selectedEntries) {
for (Entry* entry : asConst(selectedEntries)) {
m_db->recycleEntry(entry);
}
}
@ -683,8 +683,8 @@ void DatabaseWidget::unlockDatabase(bool accepted)
replaceDatabase(static_cast<DatabaseOpenWidget*>(sender())->database());
QList<Group*> groups = m_db->rootGroup()->groupsRecursive(true);
Q_FOREACH (Group* group, groups) {
const QList<Group*> groups = m_db->rootGroup()->groupsRecursive(true);
for (Group* group : groups) {
if (group->uuid() == m_groupBeforeLock) {
m_groupView->setCurrentGroup(group);
break;