diff options
-rw-r--r-- | src/OSInfo.cpp | 12 | ||||
-rw-r--r-- | src/OSInfo.h | 4 | ||||
-rw-r--r-- | src/murmur/Register.cpp | 2 |
3 files changed, 7 insertions, 11 deletions
diff --git a/src/OSInfo.cpp b/src/OSInfo.cpp index 982b2864a..e665ddb62 100644 --- a/src/OSInfo.cpp +++ b/src/OSInfo.cpp @@ -200,9 +200,6 @@ QString OSInfo::getOSDisplayableVersion(const bool appendArch) { return QString(); } - _SYSTEM_INFO si; - GetNativeSystemInfo(&si); - if (ovi.dwMajorVersion == 10) { if (ovi.wProductType == VER_NT_WORKSTATION) { os = QLatin1String("Windows 10"); @@ -327,6 +324,8 @@ QString OSInfo::getOSDisplayableVersion(const bool appendArch) { return os; } +#elif defined(Q_OS_MACOS) + const QString os = QLatin1String("macOS ") + getOSVersion(); #else const QString os = QSysInfo::prettyProductName(); #endif @@ -376,8 +375,7 @@ QString OSInfo::getOSVersion() { #endif } -void OSInfo::fillXml(QDomDocument &doc, QDomElement &root, const QString &os, const QString &osver, - const QList< QHostAddress > &qlBind) { +void OSInfo::fillXml(QDomDocument &doc, QDomElement &root, const QList< QHostAddress > &qlBind) { QDomElement tag = doc.createElement(QLatin1String("machash")); root.appendChild(tag); QDomText t = doc.createTextNode(getMacHash(qlBind)); @@ -400,7 +398,7 @@ void OSInfo::fillXml(QDomDocument &doc, QDomElement &root, const QString &os, co tag = doc.createElement(QLatin1String("os")); root.appendChild(tag); - t = doc.createTextNode(os); + t = doc.createTextNode(getOS()); tag.appendChild(t); tag = doc.createElement(QLatin1String("osarch")); @@ -410,7 +408,7 @@ void OSInfo::fillXml(QDomDocument &doc, QDomElement &root, const QString &os, co tag = doc.createElement(QLatin1String("osver")); root.appendChild(tag); - t = doc.createTextNode(osver); + t = doc.createTextNode(getOSVersion()); tag.appendChild(t); tag = doc.createElement(QLatin1String("osverbose")); diff --git a/src/OSInfo.h b/src/OSInfo.h index ae2936da8..b25a1852b 100644 --- a/src/OSInfo.h +++ b/src/OSInfo.h @@ -39,9 +39,7 @@ public: /// Examples: "10.0.19042.1", "10.16.0 20C69" static QString getOSVersion(); - static void fillXml(QDomDocument &doc, QDomElement &root, const QString &os = OSInfo::getOS(), - const QString &osver = OSInfo::getOSVersion(), - const QList< QHostAddress > & = QList< QHostAddress >()); + static void fillXml(QDomDocument &doc, QDomElement &root, const QList< QHostAddress > & = {}); }; #endif diff --git a/src/murmur/Register.cpp b/src/murmur/Register.cpp index 72f5c8449..bf05d3e1c 100644 --- a/src/murmur/Register.cpp +++ b/src/murmur/Register.cpp @@ -55,7 +55,7 @@ void Server::update() { QDomElement root = doc.createElement(QLatin1String("server")); doc.appendChild(root); - OSInfo::fillXml(doc, root, meta->qsOS, meta->qsOSVersion, qlBind); + OSInfo::fillXml(doc, root, qlBind); QDomElement tag; QDomText t; |