diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-03-02 06:28:00 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-03-02 06:28:00 -0800 |
commit | cd713d421b0fdb7d28b3c19ad0e2d989e62d5ff2 (patch) | |
tree | cefb4abed00841e3318fcb2743b2427e43d5c175 /qt-mobile | |
parent | 880f1c564413649f3fc359efefd34d3bbf01d91a (diff) | |
download | subsurface-cd713d421b0fdb7d28b3c19ad0e2d989e62d5ff2.tar.gz |
QML UI: update profile when editing duration of manually added dive
We need to make sure that a new fake DC is created after the duration was
changed.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index 0ee745933..76ffb13af 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -476,6 +476,14 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q m = r6.cap(1).toInt(); } d->dc.duration.seconds = d->duration.seconds = h * 3600 + m * 60 + s; + if (same_string(d->dc.model, "manually added dive")) { + free(d->dc.sample); + d->dc.sample = 0; + d->dc.samples = 0; + } else { + qDebug() << "changing the duration on a dive that wasn't manually added - Uh-oh"; + } + } if (get_depth_string(d->maxdepth.mm, true, true) != depth) { int depthValue = parseLengthToMm(depth); |