aboutsummaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-28 22:04:13 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-01-28 22:09:40 -0800
commit66b08f53f274e46e672354b8c8e8ab1ed446ddae (patch)
tree08f135252eb98eb5edac3c31014eb66e4c131758 /qt-mobile
parentff2f6d4082e18a766bd3366e393816b5ce75f071 (diff)
downloadsubsurface-66b08f53f274e46e672354b8c8e8ab1ed446ddae.tar.gz
QML UI: make manually added dives more like those added on desktop
By giving them a fake profile we can actually edit the dive profile in the desktop app. Fixes #998 Fixes #1000 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r--qt-mobile/qmlmanager.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index f39c37ddf..ab06cd941 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -10,6 +10,7 @@
#include "qt-models/divelistmodel.h"
#include <gpslistmodel.h>
#include "divelist.h"
+#include "device.h"
#include "pref.h"
#include "qthelper.h"
#include "qt-gui.h"
@@ -502,6 +503,14 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location
diveChanged = false; // because we already modified things
}
}
+ if (d->maxdepth.mm == d->dc.maxdepth.mm &&
+ d->maxdepth.mm > 0 &&
+ same_string(d->dc.model, "manually added dive") &&
+ d->dc.samples == 0) {
+ // so we have depth > 0, a manually added dive and no samples
+ // let's create an actual profile so the desktop version can work it
+ d->dc = *fake_dc(&d->dc);
+ }
if (diveChanged)
DiveListModel::instance()->updateDive(oldIdx, d);