Mobile: add helper function to keep selection in sync

Without this the core data structure never gets updated to reflect which
dive is currently selected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2019-10-07 22:37:31 -05:00
parent 2f0689d3b8
commit 9a73be9207
2 changed files with 10 additions and 0 deletions

View file

@ -1375,6 +1375,15 @@ bool QMLManager::undoDelete(int id)
return true;
}
void QMLManager::selectDive(int id)
{
int i;
struct dive *dive = NULL;
for_each_dive (i, dive)
dive->selected = (dive->id == id);
}
void QMLManager::deleteDive(int id)
{
struct dive *d = get_dive_by_uniq_id(id);