Utils: Introduce new class OsSpecificAspects.

This is basically a generalization of HostOsInfo for
a system that might not be the host system. HostOsInfo
is now implemented in terms of the new class.
Prospective use case: Untie Utils::Environment from
the host system.

Change-Id: If333b96674652109fcb0ad79f75aaaf5e86e17e3
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Christian Kandeler
2013-08-15 16:08:16 +02:00
committed by hjk
parent ffae1fcb24
commit 6d68422026
9 changed files with 115 additions and 38 deletions

View File

@@ -621,11 +621,11 @@ static QString checkBinary(const QDir &dir, const QString &binary)
return QString();
switch (HostOsInfo::hostOs()) {
case HostOsInfo::HostOsLinux:
case HostOsInfo::HostOsOtherUnix:
case HostOsInfo::HostOsOther:
case OsTypeLinux:
case OsTypeOtherUnix:
case OsTypeOther:
break;
case HostOsInfo::HostOsWindows: {
case OsTypeWindows: {
static const char *windowsExtensions[] = {".cmd", ".bat", ".exe", ".com" };
// Check the Windows extensions using the order
const int windowsExtensionCount = sizeof(windowsExtensions)/sizeof(const char*);
@@ -636,7 +636,7 @@ static QString checkBinary(const QDir &dir, const QString &binary)
}
}
break;
case HostOsInfo::HostOsMac: {
case OsTypeMac: {
// Check for Mac app folders
const QFileInfo appFolder(dir.filePath(binary + QLatin1String(".app")));
if (appFolder.isDir()) {