forked from qt-creator/qt-creator
Qt Quick UI: Add "kit environment" as a base environment for run
Change-Id: Ica4e63b4b8e56ee6d2ead0ad3a5d1b57de20009c Task-number: QTCREATORBUG-14701 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
@@ -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
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user