summaryrefslogtreecommitdiffstats
path: root/qt-ui/profile/diveplotdatamodel.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-03 14:34:24 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-03 14:43:32 -0700
commitd8c31135848d765a3d241d295e5d6afc311f7820 (patch)
treea45fcebd0119f43576cc41ae1936c127bd01a88c /qt-ui/profile/diveplotdatamodel.cpp
parent117b212cddda614a1c668882f8165c3a6a4f3093 (diff)
downloadsubsurface-d8c31135848d765a3d241d295e5d6afc311f7820.tar.gz
UI restructure: don't use random dives from the divelist for data
Everything should come from the displayed_dive. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/profile/diveplotdatamodel.cpp')
-rw-r--r--qt-ui/profile/diveplotdatamodel.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/qt-ui/profile/diveplotdatamodel.cpp b/qt-ui/profile/diveplotdatamodel.cpp
index 08bcf11bd..47a44768a 100644
--- a/qt-ui/profile/diveplotdatamodel.cpp
+++ b/qt-ui/profile/diveplotdatamodel.cpp
@@ -146,11 +146,6 @@ void DivePlotDataModel::setDive(dive *d, const plot_info &info)
endInsertRows();
}
-int DivePlotDataModel::id() const
-{
- return diveId;
-}
-
unsigned int DivePlotDataModel::dcShown() const
{
return dcNr;
@@ -178,9 +173,8 @@ void DivePlotDataModel::emitDataChanged()
void DivePlotDataModel::calculateDecompression()
{
- struct dive *d = get_dive_by_uniq_id(id());
- struct divecomputer *dc = select_dc(d);
- init_decompression(d);
- calculate_deco_information(d, dc, &pInfo, false);
+ struct divecomputer *dc = select_dc(&displayed_dive);
+ init_decompression(&displayed_dive);
+ calculate_deco_information(&displayed_dive, dc, &pInfo, false);
dataChanged(index(0, CEILING), index(pInfo.nr - 1, TISSUE_16));
}