Commit be3fc0ef authored by Daniel Teske's avatar Daniel Teske

Qt Quick UI: Add "kit environment" as a base environment for run

Change-Id: Ica4e63b4b8e56ee6d2ead0ad3a5d1b57de20009c
Task-number: QTCREATORBUG-14701
Reviewed-by: default avatarKai Koehne <kai.koehne@theqtcompany.com>
parent fb1360cd
......@@ -30,6 +30,8 @@
#include "qmlprojectenvironmentaspect.h"
#include <projectexplorer/target.h>
#include <projectexplorer/kit.h>
#include <utils/qtcassert.h>
namespace QmlProjectManager {
......@@ -40,19 +42,27 @@ namespace QmlProjectManager {
QList<int> QmlProjectEnvironmentAspect::possibleBaseEnvironments() const
{
return QList<int>() << static_cast<int>(SystemEnvironmentBase);
return QList<int>() << static_cast<int>(KitEnvironmentBase)
<< static_cast<int>(SystemEnvironmentBase);
}
QString QmlProjectEnvironmentAspect::baseEnvironmentDisplayName(int base) const
{
if (base == static_cast<int>(SystemEnvironmentBase))
return tr("System Environment");
if (base == static_cast<int>(KitEnvironmentBase))
return tr("Kit Environment");
return QString();
}
Utils::Environment QmlProjectManager::QmlProjectEnvironmentAspect::baseEnvironment() const
Utils::Environment QmlProjectEnvironmentAspect::baseEnvironment() const
{
return Utils::Environment::systemEnvironment();
int base = baseEnvironmentBase();
Utils::Environment env = Utils::Environment::systemEnvironment();
if (base == static_cast<int>(KitEnvironmentBase))
runConfiguration()->target()->kit()->addToEnvironment(env);
return env;
}
QmlProjectEnvironmentAspect::QmlProjectEnvironmentAspect(ProjectExplorer::RunConfiguration *rc) :
......
......@@ -51,7 +51,8 @@ public:
private:
enum BaseEnvironmentBase {
SystemEnvironmentBase = 0
SystemEnvironmentBase = 0,
KitEnvironmentBase
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment