summaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divelistmodel.cpp4
-rw-r--r--qt-models/divelistmodel.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 6edb69705..4d66c5406 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -144,12 +144,12 @@ DiveListModel::DiveListModel(QObject *parent) : QAbstractListModel(parent)
m_instance = this;
}
-void DiveListModel::addDive(QList<dive *>listOfDives)
+void DiveListModel::addDive(const QList<dive *> &listOfDives)
{
if (listOfDives.isEmpty())
return;
beginInsertRows(QModelIndex(), rowCount(), rowCount() + listOfDives.count() - 1);
- foreach (dive *d, listOfDives) {
+ for (dive *d: listOfDives) {
m_dives.append(new DiveObjectHelper(d));
}
endInsertRows();
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index 50b45caa9..37d3513bf 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -44,7 +44,7 @@ public:
static DiveListModel *instance();
DiveListModel(QObject *parent = 0);
- void addDive(QList<dive *> listOfDives);
+ void addDive(const QList<dive *> &listOfDives);
void addAllDives();
void insertDive(int i, DiveObjectHelper *newDive);
void removeDive(int i);