diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-05-19 06:38:37 +0900 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-05-19 20:12:59 +0900 |
commit | cae51ff0aa29d0e8ae312069a7473ff7cc901602 (patch) | |
tree | 05524aa816e70813b8e153f5916740d7ee743e84 /qt-ui/models.cpp | |
parent | c4899aa8f1ba9ec97818bc138c0dd63f4d02b683 (diff) | |
download | subsurface-cae51ff0aa29d0e8ae312069a7473ff7cc901602.tar.gz |
Change get_dive_by_diveid to get_dive_by_uniq_id
The original name was a really bad choice as we have a 'diveid' as part of
struct divecomputer - and that is not the diveid that is being used here.
Instead we use the 'id' member of struct dive which holds the "unique ID"
for this dive.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/models.cpp')
-rw-r--r-- | qt-ui/models.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/qt-ui/models.cpp b/qt-ui/models.cpp index c04b973e5..722ac328d 100644 --- a/qt-ui/models.cpp +++ b/qt-ui/models.cpp @@ -1056,7 +1056,7 @@ static int nitrox_sort_value(struct dive *dive) QVariant DiveItem::data(int column, int role) const { QVariant retVal; - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); switch (role) { case Qt::TextAlignmentRole: @@ -1203,7 +1203,7 @@ bool DiveItem::setData(const QModelIndex &index, const QVariant &value, int role if (d->number == v) return false; } - d = get_dive_by_diveid(diveId); + d = get_dive_by_uniq_id(diveId); d->number = value.toInt(); mark_divelist_changed(true); return true; @@ -1211,7 +1211,7 @@ bool DiveItem::setData(const QModelIndex &index, const QVariant &value, int role QString DiveItem::displayDate() const { - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); return get_dive_date_string(dive->when); } @@ -1219,7 +1219,7 @@ QString DiveItem::displayDepth() const { QString fract, str; const int scale = 1000; - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); if (get_units()->length == units::METERS) { fract = QString::number((unsigned)(dive->maxdepth.mm % scale) / 100); str = QString("%1.%2").arg((unsigned)(dive->maxdepth.mm / scale)).arg(fract, 1, QChar('0')); @@ -1233,7 +1233,7 @@ QString DiveItem::displayDepth() const QString DiveItem::displayDuration() const { int hrs, mins, secs; - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); secs = dive->duration.seconds % 60; mins = dive->duration.seconds / 60; hrs = mins / 60; @@ -1251,7 +1251,7 @@ QString DiveItem::displayDuration() const QString DiveItem::displayTemperature() const { QString str; - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); if (!dive->watertemp.mkelvin) return str; if (get_units()->temperature == units::CELSIUS) @@ -1264,7 +1264,7 @@ QString DiveItem::displayTemperature() const QString DiveItem::displaySac() const { QString str; - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); if (get_units()->volume == units::LITER) str = QString::number(dive->sac / 1000.0, 'f', 1).append(tr(" l/min")); else @@ -1280,7 +1280,7 @@ QString DiveItem::displayWeight() const int DiveItem::weight() const { - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); weight_t tw = { total_weight(dive) }; return tw.grams; } @@ -1900,7 +1900,7 @@ QVariant ProfilePrintModel::data(const QModelIndex &index, int role) const switch (role) { case Qt::DisplayRole: { - struct dive *dive = get_dive_by_diveid(diveId); + struct dive *dive = get_dive_by_uniq_id(diveId); struct DiveItem di; di.diveId = diveId; |