diff options
author | Davide Beatrici <git@davidebeatrici.dev> | 2021-02-24 00:08:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-24 00:08:24 +0300 |
commit | 569336e78a9a5d516306f2ba2d9ce7e35afbf622 (patch) | |
tree | c751b6fa8704fec0f6205c0add213a0f21ce4b36 | |
parent | 9ad316b77c6b2ecb8239e76dcc3a8bc431803f74 (diff) | |
parent | 82bbdc86e9087cfee51016611751f998b28c97fa (diff) |
Merge PR #4781: FIX/REFAC(shared): Don't pass unneeded values to OSInfo, rely on the ones it provides, fix "osverbose" not being verbose on macOS1.4.0-development-snapshot-002
-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; |