diff options
-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); |