diff options
Diffstat (limited to 'qt-models/divelistmodel.cpp')
-rw-r--r-- | qt-models/divelistmodel.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp index 86c977fc9..ccd5b8afd 100644 --- a/qt-models/divelistmodel.cpp +++ b/qt-models/divelistmodel.cpp @@ -15,6 +15,17 @@ void DiveListModel::addDive(dive *d) endInsertRows(); } +void DiveListModel::updateDive(dive *d) +{ + for (int i = 0; i < m_dives.count(); i++) { + if (m_dives.at(i).id() == d->id) { + Dive newDive(d); + m_dives.replace(i, newDive); + break; + } + } +} + void DiveListModel::clear() { if (m_dives.count()) { |