diff options
author | Joakim Bygdell <j.bygdell@gmail.com> | 2016-02-09 22:00:56 +0100 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-09 13:05:21 -0800 |
commit | 8566523b437594caf57f74d00803fc9ba0b3d6aa (patch) | |
tree | 122a0f48bc1e1d91dfc1a4b7d2187a126bfb1d94 /qt-mobile | |
parent | 0eebfb284eab0d9d2cea698e1be93d1edb1c47f1 (diff) | |
download | subsurface-8566523b437594caf57f74d00803fc9ba0b3d6aa.tar.gz |
QML UI: dive edit, treat numeric input of duration as full minutes
When editing the duration of a dive, if only numbers are entered they are
treated as full miuntes.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index a73c49fff..ad9aefd75 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -435,6 +435,7 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location QRegExp r3(QStringLiteral("(\\d*)\\s*%1").arg(tr("min")), Qt::CaseInsensitive); QRegExp r4(QStringLiteral("(\\d*):(\\d*):(\\d*)")); QRegExp r5(QStringLiteral("(\\d*):(\\d*)")); + QRegExp r6(QStringLiteral("(\\d*)")); if (r1.indexIn(duration) >= 0) { h = r1.cap(1).toInt(); m = r1.cap(2).toInt(); @@ -451,6 +452,8 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location } else if (r5.indexIn(duration) >= 0) { h = r5.cap(1).toInt(); m = r5.cap(2).toInt(); + } else if (r6.indexIn(duration) >= 0) { + m = r6.cap(1).toInt(); } d->dc.duration.seconds = d->duration.seconds = h * 3600 + m * 60 + s; } |