summaryrefslogtreecommitdiffstats
path: root/qt-mobile
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-02-10 22:53:58 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-10 15:16:09 -0800
commit3bdaf00546c483f581bfabc8377683d9f3ed7f49 (patch)
tree536dc751fd65cd19f17932951976c958078e1676 /qt-mobile
parent8566523b437594caf57f74d00803fc9ba0b3d6aa (diff)
downloadsubsurface-3bdaf00546c483f581bfabc8377683d9f3ed7f49.tar.gz
Support function to print version string
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-mobile')
-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();