aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLinus Jahn <lnj@kaidan.im>2018-12-06 19:23:13 +0100
committerJeremy Lainé <jeremy.laine@m4x.org>2019-01-03 08:44:23 +0100
commit439ad968c60d7cf44cc05cda72ebfdb1f8741045 (patch)
treee58411cc64b689db5aee4db8ecbc46b4eb515196 /src
parent1d838fb55fc7f4be8c96f8a02dfa9d1a82af2c05 (diff)
downloadqxmpp-439ad968c60d7cf44cc05cda72ebfdb1f8741045.tar.gz
Use QSysInfo for client OS in VersionManager
The QXmppVersionManager will use QSysInfo in Qt 5.4 or later to determine the client's OS, so it will also contain the OS version or some codenames.
Diffstat (limited to 'src')
-rw-r--r--src/client/QXmppVersionManager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/client/QXmppVersionManager.cpp b/src/client/QXmppVersionManager.cpp
index e32c72c2..894799fc 100644
--- a/src/client/QXmppVersionManager.cpp
+++ b/src/client/QXmppVersionManager.cpp
@@ -23,6 +23,9 @@
#include <QCoreApplication>
#include <QDomElement>
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+#include <QSysInfo>
+#endif
#include "QXmppClient.h"
#include "QXmppConstants_p.h"
@@ -45,7 +48,9 @@ QXmppVersionManager::QXmppVersionManager()
if (d->clientName.isEmpty())
d->clientName = "Based on QXmpp";
-#if defined(Q_OS_LINUX)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 4, 0)
+ d->clientOs = QSysInfo::prettyProductName();
+#elif defined(Q_OS_LINUX)
d->clientOs = QString::fromLatin1("Linux");
#elif defined(Q_OS_MAC)
d->clientOs = QString::fromLatin1("Mac OS");
@@ -129,8 +134,8 @@ QString QXmppVersionManager::clientVersion() const
/// Returns the local XMPP client's operating system.
///
-/// By default this is "Linux", "Mac OS", "Symbian" or "Windows" depending
-/// on the platform QXmpp was compiled for.
+/// By default this equals to QSysInfo::prettyProductName() which contains the
+/// OS name and version (e.g. "Windows 8.1" or "Debian GNU/Linux buster").
QString QXmppVersionManager::clientOs() const
{