Remove environmentinformation from the runconfigurations

It is no longer used.

Change-Id: Ie99af7b432bba07f8e334c99817bd535828ade8b
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Tobias Hunger
2013-01-29 18:01:47 +01:00
parent 87347bb064
commit 41804ac884
18 changed files with 6 additions and 876 deletions

View File

@@ -70,8 +70,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(ProjectExplorer::Target *
ProjectExplorer::RunConfiguration(parent, source),
m_scriptFile(source->m_scriptFile),
m_qmlViewerArgs(source->m_qmlViewerArgs),
m_isEnabled(source->m_isEnabled),
m_userEnvironmentChanges(source->m_userEnvironmentChanges)
m_isEnabled(source->m_isEnabled)
{
ctor();
}
@@ -240,13 +239,6 @@ void QmlProjectRunConfiguration::setScriptSource(MainScriptSource source,
m_configurationWidget.data()->updateFileComboBox();
}
Utils::Environment QmlProjectRunConfiguration::environment() const
{
Utils::Environment env = baseEnvironment();
env.modify(userEnvironmentChanges());
return env;
}
ProjectExplorer::Abi QmlProjectRunConfiguration::abi() const
{
ProjectExplorer::Abi hostAbi = ProjectExplorer::Abi::hostAbi();
@@ -260,8 +252,6 @@ QVariantMap QmlProjectRunConfiguration::toMap() const
map.insert(QLatin1String(Constants::QML_VIEWER_ARGUMENTS_KEY), m_qmlViewerArgs);
map.insert(QLatin1String(Constants::QML_MAINSCRIPT_KEY), m_scriptFile);
map.insert(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY),
Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges));
return map;
}
@@ -269,8 +259,6 @@ bool QmlProjectRunConfiguration::fromMap(const QVariantMap &map)
{
m_qmlViewerArgs = map.value(QLatin1String(Constants::QML_VIEWER_ARGUMENTS_KEY)).toString();
m_scriptFile = map.value(QLatin1String(Constants::QML_MAINSCRIPT_KEY), QLatin1String(M_CURRENT_FILE)).toString();
m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(
map.value(QLatin1String(Constants::USER_ENVIRONMENT_CHANGES_KEY)).toStringList());
if (m_scriptFile == QLatin1String(M_CURRENT_FILE))
setScriptSource(FileInEditor);
@@ -341,26 +329,4 @@ bool QmlProjectRunConfiguration::isValidVersion(QtSupport::BaseQtVersion *versio
return false;
}
Utils::Environment QmlProjectRunConfiguration::baseEnvironment() const
{
Utils::Environment env;
if (qtVersion())
env = qtVersion()->qmlToolsEnvironment();
return env;
}
void QmlProjectRunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff)
{
if (m_userEnvironmentChanges != diff) {
m_userEnvironmentChanges = diff;
if (m_configurationWidget)
m_configurationWidget.data()->userEnvironmentChangesChanged();
}
}
QList<Utils::EnvironmentItem> QmlProjectRunConfiguration::userEnvironmentChanges() const
{
return m_userEnvironmentChanges;
}
} // namespace QmlProjectManager

View File

@@ -33,7 +33,6 @@
#include "qmlprojectmanager_global.h"
#include <projectexplorer/runconfiguration.h>
#include <utils/environment.h>
#include <QPointer>
@@ -43,11 +42,6 @@ namespace Core {
class IEditor;
}
namespace Utils {
class Environment;
class EnvironmentItem;
}
namespace QtSupport { class BaseQtVersion; }
namespace QmlProjectManager {
@@ -84,8 +78,6 @@ public:
QString mainScript() const;
Utils::Environment environment() const;
// RunConfiguration
bool isEnabled() const;
QString disabledReason() const;
@@ -111,10 +103,6 @@ private:
static QString canonicalCapsPath(const QString &filePath);
Utils::Environment baseEnvironment() const;
void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff);
QList<Utils::EnvironmentItem> userEnvironmentChanges() const;
// absolute path to current file (if being used)
QString m_currentFileFilename;
// absolute path to selected main script (if being used)
@@ -127,8 +115,6 @@ private:
QPointer<Internal::QmlProjectRunConfigurationWidget> m_configurationWidget;
bool m_isEnabled;
QList<Utils::EnvironmentItem> m_userEnvironmentChanges;
};
} // namespace QmlProjectManager

View File

@@ -32,11 +32,9 @@
#include "qmlproject.h"
#include <coreplugin/icore.h>
#include <projectexplorer/environmentwidget.h>
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
#include <utils/detailswidget.h>
#include <utils/environment.h>
#include <QLineEdit>
#include <QComboBox>
@@ -85,33 +83,6 @@ QmlProjectRunConfigurationWidget::QmlProjectRunConfigurationWidget(QmlProjectRun
layout->addWidget(detailsWidget);
//
// Environment
//
QLabel *environmentLabel = new QLabel(this);
environmentLabel->setText(tr("Run Environment"));
QFont f = environmentLabel->font();
f.setBold(true);
f.setPointSizeF(f.pointSizeF() *1.2);
environmentLabel->setFont(f);
layout->addWidget(environmentLabel);
QWidget *baseEnvironmentWidget = new QWidget;
QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget);
baseEnvironmentLayout->setMargin(0);
m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget);
m_environmentWidget->setBaseEnvironment(rc->baseEnvironment());
m_environmentWidget->setBaseEnvironmentText(tr("System Environment"));
m_environmentWidget->setUserChanges(rc->userEnvironmentChanges());
connect(m_environmentWidget, SIGNAL(userChangesChanged()),
this, SLOT(userChangesChanged()));
layout->addWidget(m_environmentWidget);
updateFileComboBox();
}
@@ -188,15 +159,5 @@ void QmlProjectRunConfigurationWidget::onViewerArgsChanged()
m_runConfiguration->m_qmlViewerArgs = lineEdit->text();
}
void QmlProjectRunConfigurationWidget::userChangesChanged()
{
m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges());
}
void QmlProjectRunConfigurationWidget::userEnvironmentChangesChanged()
{
m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges());
}
} // namespace Internal
} // namespace QmlProjectManager

View File

@@ -35,12 +35,6 @@
QT_FORWARD_DECLARE_CLASS(QComboBox)
QT_FORWARD_DECLARE_CLASS(QStandardItemModel)
namespace ProjectExplorer {
class EnvironmentWidget;
} // namespace Qt4ProjectManager
namespace QmlProjectManager {
class QmlProjectRunConfiguration;
@@ -56,21 +50,17 @@ public:
explicit QmlProjectRunConfigurationWidget(QmlProjectRunConfiguration *rc);
public slots:
void userEnvironmentChangesChanged();
void updateFileComboBox();
private slots:
void setMainScript(int index);
void onViewerArgsChanged();
void userChangesChanged();
private:
QmlProjectRunConfiguration *m_runConfiguration;
QComboBox *m_fileListCombo;
QStandardItemModel *m_fileListModel;
ProjectExplorer::EnvironmentWidget *m_environmentWidget;
};
} // namespace Internal