summaryrefslogtreecommitdiffstats
path: root/qt-models/divelistmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r--qt-models/divelistmodel.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 6e0804743..6706d9137 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -30,16 +30,11 @@ void DiveListModel::removeDive(int i)
endRemoveRows();
}
-void DiveListModel::updateDive(dive *d)
+void DiveListModel::updateDive(int i, dive *d)
{
- for (int i = 0; i < m_dives.count(); i++) {
- if (m_dives.at(i)->id() == d->id) {
- DiveObjectHelper *newDive = new DiveObjectHelper(d);
- removeDive(i);
- insertDive(i, newDive);
- break;
- }
- }
+ DiveObjectHelper *newDive = new DiveObjectHelper(d);
+ removeDive(i);
+ insertDive(i, newDive);
}
void DiveListModel::clear()