forked from qt-creator/qt-creator
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:
@@ -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()) {
|
||||
|
||||
Reference in New Issue
Block a user