summaryrefslogtreecommitdiffstats
path: root/qt-ui/diveplanner.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-02 22:38:08 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-03 09:37:55 -0700
commit6b1b2bc919e311cc7e83f336017f35216c8da538 (patch)
treee7be0074447f2fc0f17d692c61918d99392df909 /qt-ui/diveplanner.cpp
parenta86aca037843167b26726926dbf2aebe0513afba (diff)
downloadsubsurface-6b1b2bc919e311cc7e83f336017f35216c8da538.tar.gz
UI restructure: get rid of "current" pointer in cylinders and weights
Instead always display the display_dive. Now the only thing left to slay is the stagingDive... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/diveplanner.cpp')
-rw-r--r--qt-ui/diveplanner.cpp32
1 files changed, 29 insertions, 3 deletions
diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp
index 7d8416e88..845961daa 100644
--- a/qt-ui/diveplanner.cpp
+++ b/qt-ui/diveplanner.cpp
@@ -111,7 +111,16 @@ void DivePlannerPointsModel::loadFromDive(dive *d)
copy_samples(&d->dc, &backupDive.dc);
copy_events(&d->dc, &backupDive.dc);
copy_cylinders(d, stagingDive, false); // this way the correct cylinder data is shown
- CylindersModel::instance()->setDive(stagingDive);
+
+
+
+// FIXME -- need to get rid of stagingDIve
+// the following now uses displayed_dive !!!!
+
+
+
+
+ CylindersModel::instance()->updateDive();
int lasttime = 0;
// we start with the first gas and see if it was changed
struct gasmix gas = backupDive.cylinder[0].gasmix;
@@ -768,7 +777,15 @@ bool DivePlannerPointsModel::addGas(struct gasmix mix)
modpO2.mbar = prefs.decopo2;
cyl->depth = gas_mod(&mix, modpO2, M_OR_FT(3,10));
- CylindersModel::instance()->setDive(stagingDive);
+
+
+
+ // FIXME -- need to get rid of stagingDIve
+ // the following now uses displayed_dive !!!!
+
+
+
+ CylindersModel::instance()->updateDive();
return true;
}
if (!gasmix_distance(&cyl->gasmix, &mix))
@@ -995,7 +1012,16 @@ void DivePlannerPointsModel::clear()
stagingDive = alloc_dive();
}
bool oldRecalc = setRecalc(false);
- CylindersModel::instance()->setDive(stagingDive);
+
+
+
+ // FIXME -- need to get rid of stagingDIve
+ // the following now uses displayed_dive !!!!
+
+
+
+
+ CylindersModel::instance()->updateDive();
if (rowCount() > 0) {
beginRemoveRows(QModelIndex(), 0, rowCount() - 1);
divepoints.clear();