From b1d94b247067a5cb07d6bdf8a9c2519e5309c326 Mon Sep 17 00:00:00 2001 From: Jan Mulder Date: Fri, 15 Dec 2017 21:51:24 +0100 Subject: mobile: manual add dive and cancel fails when repeated This commit fixes a very subtle bug. Probably there for ages, but never noticed. When manually adding a dive, and canceling the add right away, the divetable was extended by 1 dive (using the core function add_single_dive), but canceling never removed that dive (using delete_single_dive). This is corrected here. Notice that commit ef543da5aff296e claims to fix issue #950. With this commit, however, that issue can be seen sometimes again. Signed-off-by: Jan Mulder --- mobile-widgets/qmlmanager.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 1e56e444c..922fd8625 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1260,6 +1260,7 @@ QString QMLManager::addDive() void QMLManager::addDiveAborted(int id) { DiveListModel::instance()->removeDiveById(id); + delete_single_dive(get_idx_by_uniq_id(id)); } QString QMLManager::getCurrentPosition() -- cgit v1.2.3-70-g09d2