summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-mobile/qmlmanager.cpp2
-rw-r--r--qt-models/divelistmodel.cpp5
-rw-r--r--qt-models/divelistmodel.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 69282ee90..763de1b46 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -129,7 +129,7 @@ void QMLManager::saveChanges()
void QMLManager::addDive()
{
-
+ DiveListModel::instance()->clearDives();
}
bool QMLManager::saveCloudPassword() const
diff --git a/qt-models/divelistmodel.cpp b/qt-models/divelistmodel.cpp
index 4019bee8b..837b75f14 100644
--- a/qt-models/divelistmodel.cpp
+++ b/qt-models/divelistmodel.cpp
@@ -338,6 +338,11 @@ QHash<int, QByteArray> DiveListModel::roleNames() const
return roles;
}
+void DiveListModel::clearDives()
+{
+ m_dives.clear();
+}
+
DiveListModel *DiveListModel::instance()
{
return m_instance;
diff --git a/qt-models/divelistmodel.h b/qt-models/divelistmodel.h
index de96480bd..ad7eb99b6 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();
private:
QList<MobileDive> m_dives;
static DiveListModel *m_instance;