aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile/qmlmanager.cpp
diff options
context:
space:
mode:
authorGravatar Joakim Bygdell <j.bygdell@gmail.com>2016-01-27 18:34:34 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-27 11:18:44 -0800
commit9342dedb265ed314e1657e82aef407176f7d1e04 (patch)
tree5597c80fe1138e7341c415337599903a644be646 /qt-mobile/qmlmanager.cpp
parent4abe73ff2af49431d131f0d42fd10aa6f61b0125 (diff)
downloadsubsurface-9342dedb265ed314e1657e82aef407176f7d1e04.tar.gz
Move helper function to DiveObjectsHelper
As per Tomaz recomendation the helper functions from 19588ce and e072596 are moved from qmlmanager to DiveObjectsHelper. [Dirk Hohndel: merged with the latest code] Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile/qmlmanager.cpp')
-rw-r--r--qt-mobile/qmlmanager.cpp36
1 files changed, 0 insertions, 36 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index fb3c6de51..e80c2c082 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -708,39 +708,3 @@ QString QMLManager::getDate(const QString& diveId)
datestring = get_dive_date_string(d->when);
return datestring;
}
-
-QString QMLManager::getCylinder(const QString& diveId)
-{
- int dive_id = diveId.toInt();
- struct dive *d = get_dive_by_uniq_id(dive_id);
- QString cylinder;
- if (d){
- if (d->cylinder[1].type.description != NULL){
- cylinder = "Multiple";
- }
- else {
- cylinder = d->cylinder[0].type.description;
- }
- }
- return cylinder;
-}
-
-QString QMLManager::getWeights(const QString& diveId)
-{
- int dive_id = diveId.toInt();
- struct dive *d = get_dive_by_uniq_id(dive_id);
- int weight = 0;
- QString weights;
- if (d){
- for (int i = 0; i < MAX_WEIGHTSYSTEMS; i++)
- weight += d->weightsystem[i].weight.grams;
-
- if (informational_prefs.unit_system == IMPERIAL){
- weights = QString::number(grams_to_lbs(weight), 'f', 1) + " lbs";
- }
- else {
- weights = QString::number(weight/1000, 'f', 1) + " kg";
- }
- }
- return weights;
-}