summaryrefslogtreecommitdiffstats
path: root/subsurface-core/qthelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'subsurface-core/qthelper.cpp')
-rw-r--r--subsurface-core/qthelper.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/subsurface-core/qthelper.cpp b/subsurface-core/qthelper.cpp
index a840f4dd2..d55e8438f 100644
--- a/subsurface-core/qthelper.cpp
+++ b/subsurface-core/qthelper.cpp
@@ -791,9 +791,9 @@ 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_version());
+ QString userAgent = QString("Subsurface-mobile:%1:").arg(subsurface_canonical_version());
#else
- QString userAgent = QString("Subsurface:%1:").arg(subsurface_version());
+ QString userAgent = QString("Subsurface:%1:").arg(subsurface_canonical_version());
#endif
userAgent.append(SubsurfaceSysInfo::prettyOsName().replace(':', ' ') + ":");
arch = SubsurfaceSysInfo::buildCpuArchitecture().replace(':', ' ');
@@ -805,6 +805,13 @@ QString getUserAgent()
}
+extern "C" const char *subsurface_user_agent()
+{
+ static QString uA = getUserAgent();
+
+ return strdup(qPrintable(uA));
+}
+
QString uiLanguage(QLocale *callerLoc)
{
QString shortDateFormat;