ExtensionSystem: Replace macro usage with HostOsInfo

Change-Id: I112ff6f61e3bd06a4ccfca9c6d91037e3d814e44
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Orgad Shaneh
2016-09-10 22:56:41 +03:00
committed by Orgad Shaneh
parent a1b69a5ecf
commit ffe52196c3

View File

@@ -1600,7 +1600,7 @@ void PluginManagerPrivate::profilingSummary() const
static inline QString getPlatformName()
{
#if defined(Q_OS_MAC)
if (HostOsInfo::isMacHost()) {
if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_0) {
QString result = QLatin1String("OS X");
result += QLatin1String(" 10.") + QString::number(QSysInfo::MacintoshVersion - QSysInfo::MV_10_0);
@@ -1608,13 +1608,8 @@ static inline QString getPlatformName()
} else {
return QLatin1String("Mac OS");
}
#elif defined(Q_OS_UNIX)
QString base;
# ifdef Q_OS_LINUX
base = QLatin1String("Linux");
# else
base = QLatin1String("Unix");
# endif // Q_OS_LINUX
} else if (HostOsInfo::isAnyUnixHost()) {
QString base = QLatin1String(HostOsInfo::isLinuxHost() ? "Linux" : "Unix");
QFile osReleaseFile(QLatin1String("/etc/os-release")); // Newer Linuxes
if (osReleaseFile.open(QIODevice::ReadOnly)) {
QString name;
@@ -1635,7 +1630,7 @@ static inline QString getPlatformName()
}
}
return base;
#elif defined(Q_OS_WIN)
} else if (HostOsInfo::isWindowsHost()) {
QString result = QLatin1String("Windows");
switch (QSysInfo::WindowsVersion) {
case QSysInfo::WV_XP:
@@ -1662,7 +1657,7 @@ static inline QString getPlatformName()
if (QSysInfo::WindowsVersion >= QSysInfo::WV_WINDOWS10)
result += QLatin1String(" 10");
return result;
#endif // Q_OS_WIN
}
return QLatin1String("Unknown");
}