diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-02-06 12:07:42 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-02-06 12:07:42 -0800 |
commit | 6d8d956853f5fc6b39ef9bdab9157bbb95a155a0 (patch) | |
tree | c54e471ccb2346989273098cdc7567e81449e059 /qt-mobile | |
parent | dd53411550b0c4e9385e4848b3e9f5bda27d7490 (diff) | |
download | subsurface-6d8d956853f5fc6b39ef9bdab9157bbb95a155a0.tar.gz |
QML UI: make time parsing more lenient
White space between numbers and units should be ignored.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-rw-r--r-- | qt-mobile/qmlmanager.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp index bc0c99f4a..e6a5d9b0b 100644 --- a/qt-mobile/qmlmanager.cpp +++ b/qt-mobile/qmlmanager.cpp @@ -421,9 +421,9 @@ QString QMLManager::commitChanges(QString diveId, QString date, QString location if (get_dive_duration_string(d->duration.seconds, tr("h:"), tr("min")) != duration) { diveChanged = true; int h = 0, m = 0, s = 0; - QRegExp r1(QStringLiteral("(\\d*)%1[\\s,:]*(\\d*)%2[\\s,:]*(\\d*)%3").arg(tr("h")).arg(tr("min")).arg(tr("sec")), Qt::CaseInsensitive); - QRegExp r2(QStringLiteral("(\\d*)%1[\\s,:]*(\\d*)%2").arg(tr("h")).arg(tr("min")), Qt::CaseInsensitive); - QRegExp r3(QStringLiteral("(\\d*)%1").arg(tr("min")), Qt::CaseInsensitive); + QRegExp r1(QStringLiteral("(\\d*)\\s*%1[\\s,:]*(\\d*)\\s*%2[\\s,:]*(\\d*)\\s*%3").arg(tr("h")).arg(tr("min")).arg(tr("sec")), Qt::CaseInsensitive); + QRegExp r2(QStringLiteral("(\\d*)\\s*%1[\\s,:]*(\\d*)\\s*%2").arg(tr("h")).arg(tr("min")), Qt::CaseInsensitive); + QRegExp r3(QStringLiteral("(\\d*)\\s*%1").arg(tr("min")), Qt::CaseInsensitive); QRegExp r4(QStringLiteral("(\\d*):(\\d*):(\\d*)")); QRegExp r5(QStringLiteral("(\\d*):(\\d*)")); if (r1.indexIn(duration) >= 0) { |