Utils: Untie the Environment class from the host system.

It is used e.g. in the RemoteLinux plugin
(via ProjectExplorer::EnvironmentAspect) and should
therefore not assume that it's meant for a host system process.

Change-Id: I9f44f862f133579b65951e43fc1e654c425fd3d7
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Christian Kandeler
2013-08-15 16:54:51 +02:00
parent 6d68422026
commit 02105ddf62
3 changed files with 21 additions and 20 deletions

View File

@@ -30,6 +30,7 @@
#ifndef UTILS_ENVIRONMENT_H
#define UTILS_ENVIRONMENT_H
#include "hostosinfo.h"
#include "utils_global.h"
#include <QMap>
@@ -65,8 +66,8 @@ class QTCREATOR_UTILS_EXPORT Environment
public:
typedef QMap<QString, QString>::const_iterator const_iterator;
Environment() {}
explicit Environment(const QStringList &env);
explicit Environment(OsType osType = HostOsInfo::hostOs()) : m_osType(osType) {}
explicit Environment(const QStringList &env, OsType osType = HostOsInfo::hostOs());
static Environment systemEnvironment();
QStringList toStringList() const;
@@ -112,6 +113,7 @@ public:
private:
QString searchInDirectory(const QStringList &execs, QString directory) const;
QMap<QString, QString> m_values;
OsType m_osType;
};
} // namespace Utils