aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/divelistmodel.cpp7
-rw-r--r--qt-models/divelistmodel.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 837b75f14..7b7102f7b 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -338,9 +338,12 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
return roles;
}
-void DiveListModel::clearDives()
+void DiveListModel::startAddDive()
{
- m_dives.clear();
+ struct dive *d;
+ d = alloc_dive();
+ add_single_dive(get_divenr(d), d);
+ addDive(d);
}
DiveListModel *DiveListModel::instance()
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index ad7eb99b6..68022812c 100644
--- a/qt-models/divelistmodel.h
+++ b/qt-models/divelistmodel.h
@@ -128,7 +128,7 @@ public:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QHash<int, QByteArray> roleNames() const;
- void clearDives();
+ void startAddDive();
private:
QList<MobileDive> m_dives;
static DiveListModel *m_instance;