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 ef543da5af claims to fix issue #950.
With this commit, however, that issue can be seen sometimes
again.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
This commit is contained in:
Jan Mulder 2017-12-15 21:51:24 +01:00 committed by Dirk Hohndel
parent 2890be9256
commit b1d94b2470

View file

@ -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()