aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--qt-mobile/qmlmanager.cpp9
-rw-r--r--qt-mobile/qmlmanager.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index ad9aefd75..ff1c748a1 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -794,3 +794,12 @@ QString QMLManager::getDate(const QString& diveId)
datestring = get_dive_date_string(d->when);
return datestring;
}
+
+QString QMLManager::getVersion() const
+{
+ QRegExp versionRe(".*:([\\.,\\d]+).*");
+ if (!versionRe.exactMatch(getUserAgent()))
+ return QString();
+
+ return versionRe.cap(1);
+}
diff --git a/qt-mobile/qmlmanager.h b/qt-mobile/qmlmanager.h
index 019d0b740..6cd468260 100644
--- a/qt-mobile/qmlmanager.h
+++ b/qt-mobile/qmlmanager.h
@@ -91,6 +91,7 @@ public slots:
QString getNumber(const QString& diveId);
QString getDate(const QString& diveId);
QString getCurrentPosition();
+ QString getVersion() const;
void deleteGpsFix(quint64 when);
void refreshDiveList();