From 9f7ecbb53eabe4028f44ac420cd176bf8c76421e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 29 Jan 2016 06:25:13 -0800 Subject: Add helper to remove dive from model I tried various things to do this from QML but it just doesn't seem to work at all. So I gave up and instead added a trivial helper function. Signed-off-by: Dirk Hohndel --- qt-mobile/qmlmanager.cpp | 5 +++++ qt-mobile/qmlmanager.h | 1 + 2 files changed, 6 insertions(+) (limited to 'qt-mobile') diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index ab06cd941..f71e15100 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -556,6 +556,11 @@ QString QMLManager::addDive() return DiveListModel::instance()->startAddDive(); } +void QMLManager::addDiveAborted(int id) +{ + DiveListModel::instance()->removeDiveById(id); +} + QString QMLManager::getCurrentPosition() { return locationProvider->currentPosition(); diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h index eb225a6cf..bb8bb693d 100644 --- a/qt-mobile/qmlmanager.h +++ b/qt-mobile/qmlmanager.h @@ -77,6 +77,7 @@ public slots: void saveChanges(); QString addDive(); + void addDiveAborted(int id); void applyGpsData(); void sendGpsData(); void downloadGpsData(); -- cgit v1.2.3-70-g09d2