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

@@ -187,14 +187,14 @@ void Environment::prependOrSetPath(const QString &value)
void Environment::prependOrSetLibrarySearchPath(const QString &value)
{
switch (HostOsInfo::hostOs()) {
case HostOsInfo::HostOsWindows: {
case OsTypeWindows: {
const QChar sep = QLatin1Char(';');
const QLatin1String path("PATH");
prependOrSet(path, QDir::toNativeSeparators(value), QString(sep));
break;
}
case HostOsInfo::HostOsLinux:
case HostOsInfo::HostOsOtherUnix: {
case OsTypeLinux:
case OsTypeOtherUnix: {
const QChar sep = QLatin1Char(':');
const QLatin1String path("LD_LIBRARY_PATH");
prependOrSet(path, QDir::toNativeSeparators(value), QString(sep));