From 6616617a8771f4b3e6cece3830c8f9c55b0154c3 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 9 Sep 2016 11:21:29 -0700 Subject: Replace usages of QSysInfo with QOperatingSystemVersion Occurrences which should simply be removed entirely (due to always being true or always being false as a result of the current OS support matrix) have been left untouched for now. Change-Id: I86d5a084cb84bc28fefc5191d40924de1439b3de Reviewed-by: Liang Qi --- tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp | 2 +- tests/baselineserver/shared/baselineprotocol.cpp | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp index 5b18ab9d68..0b536f26de 100644 --- a/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp +++ b/tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp @@ -372,7 +372,7 @@ void tst_qstandardpaths::testFindExecutable_data() QTest::newRow("win-cmd-nosuffix") << QString() << QString::fromLatin1("cmd") << cmdPath; - if (QSysInfo::windowsVersion() >= QSysInfo::WV_WINDOWS8) { + if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows8) { // The logo executable on Windows 8 is perfectly suited for testing that the // suffix mechanism is not thrown off by dots in the name. const QString logo = QLatin1String("microsoft.windows.softwarelogo.showdesktop"); diff --git a/tests/baselineserver/shared/baselineprotocol.cpp b/tests/baselineserver/shared/baselineprotocol.cpp index 3335ff8ffc..be060ef745 100644 --- a/tests/baselineserver/shared/baselineprotocol.cpp +++ b/tests/baselineserver/shared/baselineprotocol.cpp @@ -90,19 +90,14 @@ PlatformInfo PlatformInfo::localHostInfo() #endif #if defined(Q_OS_LINUX) pi.insert(PI_OSName, QLS("Linux")); - QProcess uname; - uname.start(QLS("uname"), QStringList() << QLS("-r")); - if (uname.waitForFinished(3000)) - pi.insert(PI_OSVersion, QString::fromLocal8Bit(uname.readAllStandardOutput().constData()).simplified()); #elif defined(Q_OS_WIN) pi.insert(PI_OSName, QLS("Windows")); - pi.insert(PI_OSVersion, QString::number(QSysInfo::windowsVersion())); -#elif defined(Q_OS_MAC) - pi.insert(PI_OSName, QLS("MacOS")); - pi.insert(PI_OSVersion, QString::number(QSysInfo::macVersion())); +#elif defined(Q_OS_DARWIN) + pi.insert(PI_OSName, QLS("Darwin")); #else pi.insert(PI_OSName, QLS("Other")); #endif + pi.insert(PI_OSVersion, QSysInfo::kernelVersion()); #ifndef QT_NO_PROCESS QProcess git; -- cgit v1.2.3