diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-11-08 16:58:33 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-11-18 16:50:09 -0800 |
commit | 6b283e598a3a08c6133d66b5d5617370296e7d0e (patch) | |
tree | 685ccf1fd839d72471b179bf12aa72d2bdcec7de /mobile-widgets/qmlmanager.cpp | |
parent | bc7afebc23477ef23f2b9741bf45b2180cbafe15 (diff) | |
download | subsurface-6b283e598a3a08c6133d66b5d5617370296e7d0e.tar.gz |
Dive list: replace dive-list of trips by a table
The dives of each trip were kept in a list. Replace this by a
struct dive_table. This will make it significantly easier to
keep the dives of a trip in sorted state.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 8bae01d86..cc98286a2 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -1275,8 +1275,6 @@ bool QMLManager::undoDelete(int id) struct dive_trip *trip = deletedDive->divetrip; tripflag_t tripflag = deletedDive->tripflag; // this gets overwritten in add_dive_to_trip() deletedDive->divetrip = NULL; - deletedDive->next = NULL; - deletedDive->pprev = NULL; add_dive_to_trip(deletedDive, trip); deletedDive->tripflag = tripflag; } @@ -1309,11 +1307,11 @@ void QMLManager::deleteDive(int id) memset(deletedTrip, 0, sizeof(struct dive_trip)); } // if this is the last dive in that trip, remember the trip as well - if (d->divetrip && d->divetrip->nrdives == 1) { + if (d->divetrip && d->divetrip->dives.nr == 1) { *deletedTrip = *d->divetrip; deletedTrip->location = copy_string(d->divetrip->location); deletedTrip->notes = copy_string(d->divetrip->notes); - deletedTrip->nrdives = 0; + deletedTrip->dives.nr = 0; deletedDive->divetrip = deletedTrip; } DiveListModel::instance()->removeDiveById(id); |