aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-05 12:53:38 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-03-05 17:00:14 -0800
commitd42b7f55c4e0aea004a2ba7ba135c173f3615290 (patch)
tree0f3522fe6d1ac96df74055619245787a681d3237
parent5aa94578f79d4364cd9007fafc7370bfb5a89aff (diff)
downloadsubsurface-d42b7f55c4e0aea004a2ba7ba135c173f3615290.tar.gz
Introduce separate version number for Subsurface-mobile
This is hard coded in version.cmake for now. The intent is to go to 1.0 in the first release version and to increment from there whenever we create an update. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--cmake/Modules/HandleVersionGeneration.cmake1
-rw-r--r--cmake/Modules/version.cmake1
-rw-r--r--qt-mobile/qmlmanager.cpp2
-rw-r--r--subsurface-core/qthelper.cpp2
-rw-r--r--subsurface-core/version.c7
-rw-r--r--subsurface-core/version.h4
6 files changed, 15 insertions, 2 deletions
diff --git a/cmake/Modules/HandleVersionGeneration.cmake b/cmake/Modules/HandleVersionGeneration.cmake
index 4ef42e71f..4b52a6804 100644
--- a/cmake/Modules/HandleVersionGeneration.cmake
+++ b/cmake/Modules/HandleVersionGeneration.cmake
@@ -2,6 +2,7 @@
file(WRITE ${CMAKE_BINARY_DIR}/version.h.in
"#define GIT_VERSION_STRING \"@GIT_VERSION_STRING@\"
#define CANONICAL_VERSION_STRING \"@CANONICAL_VERSION_STRING@\"
+#define MOBILE_VERSION_STRING \"@MOBILE_VERSION_STRING@\"
")
file(COPY cmake/Modules/version.cmake
diff --git a/cmake/Modules/version.cmake b/cmake/Modules/version.cmake
index 2fc011ffd..dcff01d74 100644
--- a/cmake/Modules/version.cmake
+++ b/cmake/Modules/version.cmake
@@ -10,6 +10,7 @@ execute_process(
OUTPUT_VARIABLE CANONICAL_VERSION_STRING
OUTPUT_STRIP_TRAILING_WHITESPACE
)
+set(MOBILE_VERSION_STRING "0.93")
configure_file(${SRC} ${DST} @ONLY)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
diff --git a/qt-mobile/qmlmanager.cpp b/qt-mobile/qmlmanager.cpp
index 94344f9f3..6851ec079 100644
--- a/qt-mobile/qmlmanager.cpp
+++ b/qt-mobile/qmlmanager.cpp
@@ -936,7 +936,7 @@ QString QMLManager::getDate(const QString& diveId)
QString QMLManager::getVersion() const
{
- QRegExp versionRe(".*:([\\.,\\d]+).*");
+ QRegExp versionRe(".*:([()\\.,\\d]+).*");
if (!versionRe.exactMatch(getUserAgent()))
return QString();
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index d1c6a8826..72221eacf 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -460,7 +460,7 @@ QString getUserAgent()
// fill in the system data - use ':' as separator
// replace all other ':' with ' ' so that this is easy to parse
#ifdef SUBSURFACE_MOBILE
- QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_canonical_version());
+ QString userAgent = QString("Subsurface-mobile:%1(%2):").arg(subsurface_mobile_version()).arg(subsurface_canonical_version());
#else
QString userAgent = QString("Subsurface:%1:").arg(subsurface_canonical_version());
#endif
diff --git a/subsurface-core/version.c b/subsurface-core/version.c
index 98207efe2..764e4d2db 100644
--- a/subsurface-core/version.c
+++ b/subsurface-core/version.c
@@ -9,3 +9,10 @@ const char *subsurface_canonical_version(void)
{
return CANONICAL_VERSION_STRING;
}
+
+#ifdef SUBSURFACE_MOBILE
+const char *subsurface_mobile_version(void)
+{
+ return MOBILE_VERSION_STRING;
+}
+#endif
diff --git a/subsurface-core/version.h b/subsurface-core/version.h
index 98385e970..0a3204bd9 100644
--- a/subsurface-core/version.h
+++ b/subsurface-core/version.h
@@ -8,6 +8,10 @@ extern "C" {
const char *subsurface_git_version(void);
const char *subsurface_canonical_version(void);
+#ifdef SUBSURFACE_MOBILE
+const char *subsurface_mobile_version(void);
+#endif
+
#ifdef __cplusplus
}
#endif