Turn two for loops into Q_FOREACH.

This commit is contained in:
Felix Geyer 2013-04-07 11:52:55 +02:00
parent 4b3bee6400
commit 701013baab
2 changed files with 6 additions and 6 deletions

View File

@ -213,12 +213,12 @@ QMimeData* EntryModel::mimeData(const QModelIndexList& indexes) const
QSet<Entry*> seenEntries;
for (int i = 0; i < indexes.size(); i++) {
if (!indexes[i].isValid()) {
Q_FOREACH (const QModelIndex& index, indexes) {
if (!index.isValid()) {
continue;
}
Entry* entry = entryFromIndex(indexes[i]);
Entry* entry = entryFromIndex(index);
if (!seenEntries.contains(entry)) {
// make sure we don't add entries multiple times when we get indexes
// with the same row but different columns

View File

@ -299,12 +299,12 @@ QMimeData* GroupModel::mimeData(const QModelIndexList& indexes) const
QSet<Group*> seenGroups;
for (int i = 0; i < indexes.size(); i++) {
if (!indexes[i].isValid()) {
Q_FOREACH (const QModelIndex& index, indexes) {
if (!index.isValid()) {
continue;
}
Group* group = groupFromIndex(indexes[i]);
Group* group = groupFromIndex(index);
if (!seenGroups.contains(group)) {
// make sure we don't add groups multiple times when we get indexes
// with the same row but different columns