diff options
author | Tobias Hunger <tobias.hunger@digia.com> | 2013-01-29 18:01:47 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@digia.com> | 2013-04-11 15:15:18 +0200 |
commit | 41804ac884f8ca857785b50cb3256df95195ff8b (patch) | |
tree | 49136684bd4663c27253d53bda99d5387e29eb34 | |
parent | 87347bb064f81f9f7727bf8800b0964d57d34c22 (diff) | |
download | qt-creator-41804ac884f8ca857785b50cb3256df95195ff8b.tar.gz |
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>
18 files changed, 6 insertions, 876 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp index aa3676ea2f..0d9fa3dcfc 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.cpp @@ -37,7 +37,6 @@ #include <coreplugin/helpmanager.h> #include <qtsupport/qtkitinformation.h> #include <projectexplorer/environmentaspect.h> -#include <projectexplorer/environmentwidget.h> #include <projectexplorer/target.h> #include <utils/pathchooser.h> @@ -64,8 +63,6 @@ const char USER_WORKING_DIRECTORY_KEY[] = "CMakeProjectManager.CMakeRunConfigura const char USE_TERMINAL_KEY[] = "CMakeProjectManager.CMakeRunConfiguration.UseTerminal"; const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title"; const char ARGUMENTS_KEY[] = "CMakeProjectManager.CMakeRunConfiguration.Arguments"; -const char USER_ENVIRONMENT_CHANGES_KEY[] = "CMakeProjectManager.CMakeRunConfiguration.UserEnvironmentChanges"; -const char BASE_ENVIRONMENT_BASE_KEY[] = "CMakeProjectManager.BaseEnvironmentBase"; } // namespace @@ -76,7 +73,6 @@ CMakeRunConfiguration::CMakeRunConfiguration(ProjectExplorer::Target *parent, Co m_buildTarget(target), m_workingDirectory(workingDirectory), m_title(title), - m_baseEnvironmentBase(CMakeRunConfiguration::BuildEnvironmentBase), m_enabled(true) { ctor(); @@ -90,8 +86,6 @@ CMakeRunConfiguration::CMakeRunConfiguration(ProjectExplorer::Target *parent, CM m_userWorkingDirectory(source->m_userWorkingDirectory), m_title(source->m_title), m_arguments(source->m_arguments), - m_userEnvironmentChanges(source->m_userEnvironmentChanges), - m_baseEnvironmentBase(source->m_baseEnvironmentBase), m_enabled(source->m_enabled) { ctor(); @@ -104,8 +98,6 @@ CMakeRunConfiguration::~CMakeRunConfiguration() void CMakeRunConfiguration::ctor() { setDefaultDisplayName(defaultDisplayName()); - connect(target(), SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); } QString CMakeRunConfiguration::executable() const @@ -128,7 +120,7 @@ QString CMakeRunConfiguration::workingDirectory() const ProjectExplorer::EnvironmentAspect *aspect = extraAspect<ProjectExplorer::EnvironmentAspect>(); QTC_ASSERT(aspect, return QString()); return QDir::cleanPath(aspect->environment().expandVariables( - Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); + Utils::expandMacros(baseWorkingDirectory(), macroExpander()))); } QString CMakeRunConfiguration::baseWorkingDirectory() const @@ -183,8 +175,6 @@ QVariantMap CMakeRunConfiguration::toMap() const map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); map.insert(QLatin1String(TITLE_KEY), m_title); map.insert(QLatin1String(ARGUMENTS_KEY), m_arguments); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); - map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase); return map; } @@ -195,8 +185,6 @@ bool CMakeRunConfiguration::fromMap(const QVariantMap &map) m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; m_title = map.value(QLatin1String(TITLE_KEY)).toString(); m_arguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString(); - m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); - m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CMakeRunConfiguration::BuildEnvironmentBase)).toInt()); return RunConfiguration::fromMap(map); } @@ -228,64 +216,6 @@ QStringList CMakeRunConfiguration::dumperLibraryLocations() const return QtSupport::QtKitInformation::dumperLibraryLocations(target()->kit()); } -Utils::Environment CMakeRunConfiguration::baseEnvironment() const -{ - Utils::Environment env; - if (m_baseEnvironmentBase == CMakeRunConfiguration::CleanEnvironmentBase) { - // Nothing - } else if (m_baseEnvironmentBase == CMakeRunConfiguration::SystemEnvironmentBase) { - env = Utils::Environment::systemEnvironment(); - } else if (m_baseEnvironmentBase == CMakeRunConfiguration::BuildEnvironmentBase) { - env = activeBuildConfiguration()->environment(); - } - return env; -} - -QString CMakeRunConfiguration::baseEnvironmentText() const -{ - if (m_baseEnvironmentBase == CMakeRunConfiguration::CleanEnvironmentBase) { - return tr("Clean Environment"); - } else if (m_baseEnvironmentBase == CMakeRunConfiguration::SystemEnvironmentBase) { - return tr("System Environment"); - } else if (m_baseEnvironmentBase == CMakeRunConfiguration::BuildEnvironmentBase) { - return tr("Build Environment"); - } - return QString(); -} - -void CMakeRunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) -{ - if (m_baseEnvironmentBase == env) - return; - m_baseEnvironmentBase = env; - emit baseEnvironmentChanged(); -} - -CMakeRunConfiguration::BaseEnvironmentBase CMakeRunConfiguration::baseEnvironmentBase() const -{ - return m_baseEnvironmentBase; -} - -Utils::Environment CMakeRunConfiguration::environment() const -{ - Utils::Environment env = baseEnvironment(); - env.modify(userEnvironmentChanges()); - return env; -} - -QList<Utils::EnvironmentItem> CMakeRunConfiguration::userEnvironmentChanges() const -{ - return m_userEnvironmentChanges; -} - -void CMakeRunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) -{ - if (m_userEnvironmentChanges != diff) { - m_userEnvironmentChanges = diff; - emit userEnvironmentChangesChanged(diff); - } -} - void CMakeRunConfiguration::setEnabled(bool b) { if (m_enabled == b) @@ -356,37 +286,6 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * vbx->setMargin(0);; vbx->addWidget(m_detailsContainer); - 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); - vbx->addWidget(environmentLabel); - - QWidget *baseEnvironmentWidget = new QWidget; - QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); - baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this runconfiguration:"), this); - baseEnvironmentLayout->addWidget(label); - m_baseEnvironmentComboBox = new QComboBox(this); - m_baseEnvironmentComboBox->addItems(QStringList() - << tr("Clean Environment") - << tr("System Environment") - << tr("Build Environment")); - m_baseEnvironmentComboBox->setCurrentIndex(m_cmakeRunConfiguration->baseEnvironmentBase()); - connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(baseEnvironmentComboBoxChanged(int))); - baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); - baseEnvironmentLayout->addStretch(10); - - m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); - m_environmentWidget->setBaseEnvironment(m_cmakeRunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_cmakeRunConfiguration->baseEnvironmentText()); - m_environmentWidget->setUserChanges(m_cmakeRunConfiguration->userEnvironmentChanges()); - - vbx->addWidget(m_environmentWidget); - connect(m_workingDirectoryEdit, SIGNAL(changed(QString)), this, SLOT(setWorkingDirectory())); @@ -396,15 +295,8 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration * connect(runInTerminal, SIGNAL(toggled(bool)), this, SLOT(runInTerminalToggled(bool))); - connect(m_environmentWidget, SIGNAL(userChangesChanged()), - this, SLOT(userChangesChanged())); - connect(m_cmakeRunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)), this, SLOT(workingDirectoryChanged(QString))); - connect(m_cmakeRunConfiguration, SIGNAL(baseEnvironmentChanged()), - this, SLOT(baseEnvironmentChanged())); - connect(m_cmakeRunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), - this, SLOT(userEnvironmentChangesChanged())); setEnabled(m_cmakeRunConfiguration->isEnabled()); } @@ -447,37 +339,6 @@ void CMakeRunConfigurationWidget::environmentWasChanged() QTC_ASSERT(aspect, return); m_workingDirectoryEdit->setEnvironment(aspect->environment()); } - -void CMakeRunConfigurationWidget::userChangesChanged() -{ - m_cmakeRunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); -} - -void CMakeRunConfigurationWidget::baseEnvironmentComboBoxChanged(int index) -{ - m_ignoreChange = true; - m_cmakeRunConfiguration->setBaseEnvironmentBase(CMakeRunConfiguration::BaseEnvironmentBase(index)); - - m_environmentWidget->setBaseEnvironment(m_cmakeRunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_cmakeRunConfiguration->baseEnvironmentText()); - m_ignoreChange = false; -} - -void CMakeRunConfigurationWidget::baseEnvironmentChanged() -{ - if (m_ignoreChange) - return; - - m_baseEnvironmentComboBox->setCurrentIndex(m_cmakeRunConfiguration->baseEnvironmentBase()); - m_environmentWidget->setBaseEnvironment(m_cmakeRunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_cmakeRunConfiguration->baseEnvironmentText()); -} - -void CMakeRunConfigurationWidget::userEnvironmentChangesChanged() -{ - m_environmentWidget->setUserChanges(m_cmakeRunConfiguration->userEnvironmentChanges()); -} - void CMakeRunConfigurationWidget::setArguments(const QString &args) { m_cmakeRunConfiguration->setCommandLineArguments(args); diff --git a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h index d6b73ad557..355a8ee4d1 100644 --- a/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h +++ b/src/plugins/cmakeprojectmanager/cmakerunconfiguration.h @@ -42,10 +42,6 @@ class PathChooser; class DetailsWidget; } -namespace ProjectExplorer { -class EnvironmentWidget; -} - namespace CMakeProjectManager { namespace Internal { @@ -67,7 +63,6 @@ public: void setRunMode(RunMode runMode); QString workingDirectory() const; QString commandLineArguments() const; - Utils::Environment environment() const; QWidget *createConfigurationWidget(); void setExecutable(const QString &executable); @@ -86,8 +81,6 @@ public: QString disabledReason() const; signals: - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); void baseWorkingDirectoryChanged(const QString&); private slots: @@ -103,25 +96,12 @@ private: QString baseWorkingDirectory() const; void ctor(); - enum BaseEnvironmentBase { CleanEnvironmentBase = 0, - SystemEnvironmentBase = 1, - BuildEnvironmentBase = 2}; - void setBaseEnvironmentBase(BaseEnvironmentBase env); - BaseEnvironmentBase baseEnvironmentBase() const; - Utils::Environment baseEnvironment() const; - QString baseEnvironmentText() const; - - void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); - QList<Utils::EnvironmentItem> userEnvironmentChanges() const; - RunMode m_runMode; QString m_buildTarget; QString m_workingDirectory; QString m_userWorkingDirectory; QString m_title; QString m_arguments; - QList<Utils::EnvironmentItem> m_userEnvironmentChanges; - BaseEnvironmentBase m_baseEnvironmentBase; bool m_enabled; }; @@ -133,15 +113,11 @@ public: private slots: void setArguments(const QString &args); - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(); - void userChangesChanged(); void setWorkingDirectory(); void resetWorkingDirectory(); void runInTerminalToggled(bool toggled); void environmentWasChanged(); - void baseEnvironmentComboBoxChanged(int index); void workingDirectoryChanged(const QString &workingDirectory); private: @@ -149,8 +125,6 @@ private: bool m_ignoreChange; CMakeRunConfiguration *m_cmakeRunConfiguration; Utils::PathChooser *m_workingDirectoryEdit; - QComboBox *m_baseEnvironmentComboBox; - ProjectExplorer::EnvironmentWidget *m_environmentWidget; Utils::DetailsWidget *m_detailsContainer; }; diff --git a/src/plugins/madde/maemorunconfigurationwidget.cpp b/src/plugins/madde/maemorunconfigurationwidget.cpp index 23171be9d9..e879b91e14 100644 --- a/src/plugins/madde/maemorunconfigurationwidget.cpp +++ b/src/plugins/madde/maemorunconfigurationwidget.cpp @@ -37,7 +37,6 @@ #include <coreplugin/coreconstants.h> #include <coreplugin/icore.h> #include <debugger/debuggerrunconfigurationaspect.h> -#include <projectexplorer/environmentwidget.h> #include <projectexplorer/kitinformation.h> #include <projectexplorer/target.h> #include <qt4projectmanager/qt4buildconfiguration.h> diff --git a/src/plugins/projectexplorer/localapplicationrunconfiguration.h b/src/plugins/projectexplorer/localapplicationrunconfiguration.h index de3d15b309..ed66443d2d 100644 --- a/src/plugins/projectexplorer/localapplicationrunconfiguration.h +++ b/src/plugins/projectexplorer/localapplicationrunconfiguration.h @@ -53,7 +53,6 @@ public: virtual RunMode runMode() const = 0; virtual QString workingDirectory() const = 0; virtual QString commandLineArguments() const = 0; - virtual Utils::Environment environment() const = 0; virtual QString dumperLibrary() const = 0; virtual QStringList dumperLibraryLocations() const = 0; diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp index 1e7bd342aa..ce8e908125 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp @@ -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 diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h index 2bc2e894c0..c94ead417e 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.h @@ -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 diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp index fb19ce4809..da2e7262bc 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.cpp @@ -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 diff --git a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h index b89713da11..1e1f038682 100644 --- a/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h +++ b/src/plugins/qmlprojectmanager/qmlprojectrunconfigurationwidget.h @@ -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 diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp index 0d04991d3a..eb5454c250 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp @@ -35,7 +35,6 @@ #include <coreplugin/coreconstants.h> #include <projectexplorer/localenvironmentaspect.h> -#include <projectexplorer/environmentwidget.h> #include <projectexplorer/target.h> #include <utils/qtcprocess.h> #include <utils/pathchooser.h> @@ -69,8 +68,6 @@ const char COMMAND_LINE_ARGUMENTS_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration const char PRO_FILE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.ProFile"; const char USE_TERMINAL_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.UseTerminal"; const char USE_DYLD_IMAGE_SUFFIX_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix"; -const char USER_ENVIRONMENT_CHANGES_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.UserEnvironmentChanges"; -const char BASE_ENVIRONMENT_BASE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.BaseEnvironmentBase"; const char USER_WORKING_DIRECTORY_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"; QString pathFromId(Core::Id id) @@ -88,8 +85,7 @@ Qt4RunConfiguration::Qt4RunConfiguration(ProjectExplorer::Target *parent, Core:: LocalApplicationRunConfiguration(parent, id), m_proFilePath(pathFromId(id)), m_runMode(Gui), - m_isUsingDyldImageSuffix(false), - m_baseEnvironmentBase(Qt4RunConfiguration::BuildEnvironmentBase) + m_isUsingDyldImageSuffix(false) { Qt4Project *project = static_cast<Qt4Project *>(parent->project()); m_parseSuccess = project->validParse(m_proFilePath); @@ -105,8 +101,6 @@ Qt4RunConfiguration::Qt4RunConfiguration(ProjectExplorer::Target *parent, Qt4Run m_runMode(source->m_runMode), m_isUsingDyldImageSuffix(source->m_isUsingDyldImageSuffix), m_userWorkingDirectory(source->m_userWorkingDirectory), - m_userEnvironmentChanges(source->m_userEnvironmentChanges), - m_baseEnvironmentBase(source->m_baseEnvironmentBase), m_parseSuccess(source->m_parseSuccess), m_parseInProgress(source->m_parseInProgress) { @@ -168,8 +162,6 @@ void Qt4RunConfiguration::ctor() QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit()); m_forcedGuiMode = (version && version->type() == QLatin1String(QtSupport::Constants::SIMULATORQT)); - connect(target(), SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); connect(target()->project(), SIGNAL(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool)), this, SLOT(proFileUpdated(Qt4ProjectManager::Qt4ProFileNode*,bool,bool))); connect(target(), SIGNAL(kitChanged()), @@ -270,37 +262,6 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run this, SLOT(usingDyldImageSuffixToggled(bool))); } - 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); - vboxTopLayout->addWidget(environmentLabel); - - QWidget *baseEnvironmentWidget = new QWidget(this); - QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); - baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); - baseEnvironmentLayout->addWidget(label); - m_baseEnvironmentComboBox = new QComboBox(this); - m_baseEnvironmentComboBox->addItems(QStringList() - << tr("Clean Environment") - << tr("System Environment") - << tr("Build Environment")); - m_baseEnvironmentComboBox->setCurrentIndex(qt4RunConfiguration->baseEnvironmentBase()); - connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(baseEnvironmentSelected(int))); - baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); - baseEnvironmentLayout->addStretch(10); - - m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); - m_environmentWidget->setBaseEnvironment(m_qt4RunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_qt4RunConfiguration->baseEnvironmentText()); - m_environmentWidget->setUserChanges(m_qt4RunConfiguration->userEnvironmentChanges()); - m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - vboxTopLayout->addWidget(m_environmentWidget); - runConfigurationEnabledChange(); connect(m_workingDirectoryEdit, SIGNAL(changed(QString)), @@ -316,9 +277,6 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run connect(m_useQvfbCheck, SIGNAL(toggled(bool)), this, SLOT(qvfbToggled(bool))); - connect(m_environmentWidget, SIGNAL(userChangesChanged()), - this, SLOT(userChangesEdited())); - connect(qt4RunConfiguration, SIGNAL(baseWorkingDirectoryChanged(QString)), this, SLOT(workingDirectoryChanged(QString))); @@ -331,12 +289,6 @@ Qt4RunConfigurationWidget::Qt4RunConfigurationWidget(Qt4RunConfiguration *qt4Run connect(qt4RunConfiguration, SIGNAL(effectiveTargetInformationChanged()), this, SLOT(effectiveTargetInformationChanged()), Qt::QueuedConnection); - connect(qt4RunConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), - this, SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>))); - - connect(qt4RunConfiguration, SIGNAL(baseEnvironmentChanged()), - this, SLOT(baseEnvironmentChanged())); - connect(qt4RunConfiguration, SIGNAL(enabledChanged()), this, SLOT(runConfigurationEnabledChange())); } @@ -345,40 +297,6 @@ Qt4RunConfigurationWidget::~Qt4RunConfigurationWidget() { } -void Qt4RunConfigurationWidget::baseEnvironmentSelected(int index) -{ - m_ignoreChange = true; - m_qt4RunConfiguration->setBaseEnvironmentBase(Qt4RunConfiguration::BaseEnvironmentBase(index)); - - m_environmentWidget->setBaseEnvironment(m_qt4RunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_qt4RunConfiguration->baseEnvironmentText()); - m_ignoreChange = false; -} - -void Qt4RunConfigurationWidget::baseEnvironmentChanged() -{ - if (m_ignoreChange) - return; - - m_baseEnvironmentComboBox->setCurrentIndex(m_qt4RunConfiguration->baseEnvironmentBase()); - m_environmentWidget->setBaseEnvironment(m_qt4RunConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_qt4RunConfiguration->baseEnvironmentText()); -} - -void Qt4RunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges) -{ - if (m_ignoreChange) - return; - m_environmentWidget->setUserChanges(userChanges); -} - -void Qt4RunConfigurationWidget::userChangesEdited() -{ - m_ignoreChange = true; - m_qt4RunConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); - m_ignoreChange = false; -} - void Qt4RunConfigurationWidget::environmentWasChanged() { ProjectExplorer::EnvironmentAspect *aspect @@ -390,8 +308,6 @@ void Qt4RunConfigurationWidget::environmentWasChanged() void Qt4RunConfigurationWidget::runConfigurationEnabledChange() { bool enabled = m_qt4RunConfiguration->isEnabled(); - m_detailsContainer->setEnabled(enabled); - m_environmentWidget->setEnabled(enabled); m_disabledIcon->setVisible(!enabled); m_disabledReason->setVisible(!enabled); m_disabledReason->setText(m_qt4RunConfiguration->disabledReason()); @@ -505,8 +421,6 @@ QVariantMap Qt4RunConfiguration::toMap() const map.insert(QLatin1String(PRO_FILE_KEY), projectDir.relativeFilePath(m_proFilePath)); map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); map.insert(QLatin1String(USE_DYLD_IMAGE_SUFFIX_KEY), m_isUsingDyldImageSuffix); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); - map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), m_baseEnvironmentBase); map.insert(QLatin1String(USER_WORKING_DIRECTORY_KEY), m_userWorkingDirectory); return map; } @@ -521,9 +435,6 @@ bool Qt4RunConfiguration::fromMap(const QVariantMap &map) m_userWorkingDirectory = map.value(QLatin1String(USER_WORKING_DIRECTORY_KEY)).toString(); - m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); - m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(Qt4RunConfiguration::BuildEnvironmentBase)).toInt()); - m_parseSuccess = static_cast<Qt4Project *>(target()->project())->validParse(m_proFilePath); m_parseInProgress = static_cast<Qt4Project *>(target()->project())->parseInProgress(m_proFilePath); @@ -595,75 +506,6 @@ QString Qt4RunConfiguration::rawCommandLineArguments() const return m_commandLineArguments; } -QString Qt4RunConfiguration::baseEnvironmentText() const -{ - if (m_baseEnvironmentBase == Qt4RunConfiguration::CleanEnvironmentBase) - return tr("Clean Environment"); - else if (m_baseEnvironmentBase == Qt4RunConfiguration::SystemEnvironmentBase) - return tr("System Environment"); - else if (m_baseEnvironmentBase == Qt4RunConfiguration::BuildEnvironmentBase) - return tr("Build Environment"); - return QString(); -} - -Utils::Environment Qt4RunConfiguration::baseEnvironment() const -{ - Utils::Environment env; - if (m_baseEnvironmentBase == Qt4RunConfiguration::CleanEnvironmentBase) { - // Nothing - } else if (m_baseEnvironmentBase == Qt4RunConfiguration::SystemEnvironmentBase) { - env = Utils::Environment::systemEnvironment(); - } else if (m_baseEnvironmentBase == Qt4RunConfiguration::BuildEnvironmentBase - && target()->activeBuildConfiguration()) { - env = target()->activeBuildConfiguration()->environment(); - } - if (m_isUsingDyldImageSuffix) - env.set(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug")); - - // The user could be linking to a library found via a -L/some/dir switch - // to find those libraries while actually running we explicitly prepend those - // dirs to the library search path - const Qt4ProFileNode *node = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->findProFileFor(m_proFilePath); - if (node) { - const QStringList libDirectories = node->variableValue(LibDirectoriesVar); - if (!libDirectories.isEmpty()) { - const QString proDirectory = node->buildDir(); - foreach (QString dir, libDirectories) { - // Fix up relative entries like "LIBS+=-L.." - const QFileInfo fi(dir); - if (!fi.isAbsolute()) - dir = QDir::cleanPath(proDirectory + QLatin1Char('/') + dir); - env.prependOrSetLibrarySearchPath(dir); - } // foreach - } // libDirectories - } // node - - QtSupport::BaseQtVersion *qtVersion = QtSupport::QtKitInformation::qtVersion(target()->kit()); - if (qtVersion) - env.prependOrSetLibrarySearchPath(qtVersion->qmakeProperty("QT_INSTALL_LIBS")); - return env; -} - -Utils::Environment Qt4RunConfiguration::environment() const -{ - Utils::Environment env = baseEnvironment(); - env.modify(userEnvironmentChanges()); - return env; -} - -QList<Utils::EnvironmentItem> Qt4RunConfiguration::userEnvironmentChanges() const -{ - return m_userEnvironmentChanges; -} - -void Qt4RunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) -{ - if (m_userEnvironmentChanges != diff) { - m_userEnvironmentChanges = diff; - emit userEnvironmentChangesChanged(diff); - } -} - void Qt4RunConfiguration::setBaseWorkingDirectory(const QString &wd) { const QString &oldWorkingDirectory = workingDirectory(); @@ -740,19 +582,6 @@ QString Qt4RunConfiguration::defaultDisplayName() return defaultName; } -void Qt4RunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) -{ - if (m_baseEnvironmentBase == env) - return; - m_baseEnvironmentBase = env; - emit baseEnvironmentChanged(); -} - -Qt4RunConfiguration::BaseEnvironmentBase Qt4RunConfiguration::baseEnvironmentBase() const -{ - return m_baseEnvironmentBase; -} - Utils::OutputFormatter *Qt4RunConfiguration::createOutputFormatter() const { return new QtSupport::QtOutputFormatter(target()->project()); diff --git a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h index 801782239f..e86ab9b709 100644 --- a/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h +++ b/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.h @@ -34,7 +34,6 @@ #include <projectexplorer/localapplicationrunconfiguration.h> -#include <utils/environment.h> #include <QStringList> #include <QLabel> @@ -52,10 +51,6 @@ class PathChooser; class DetailsWidget; } -namespace ProjectExplorer { - class EnvironmentWidget; -} - namespace Qt4ProjectManager { class Qt4Project; @@ -85,7 +80,6 @@ public: bool forcedGuiMode() const; virtual QString workingDirectory() const; virtual QString commandLineArguments() const; - virtual Utils::Environment environment() const; QString dumperLibrary() const; QStringList dumperLibraryLocations() const; @@ -107,8 +101,6 @@ signals: void baseWorkingDirectoryChanged(const QString&); void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); void usingDyldImageSuffixChanged(bool); - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); // Note: These signals might not get emitted for every change! void effectiveTargetInformationChanged(); @@ -126,20 +118,10 @@ private: QString baseWorkingDirectory() const; void setCommandLineArguments(const QString &argumentsString); QString rawCommandLineArguments() const; - enum BaseEnvironmentBase { CleanEnvironmentBase = 0, - SystemEnvironmentBase = 1, - BuildEnvironmentBase = 2 }; QString defaultDisplayName(); - void setBaseEnvironmentBase(BaseEnvironmentBase env); - BaseEnvironmentBase baseEnvironmentBase() const; void ctor(); - Utils::Environment baseEnvironment() const; - QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); - QList<Utils::EnvironmentItem> userEnvironmentChanges() const; - void updateTarget(); QString m_commandLineArguments; QString m_proFilePath; // Full path to the Application Pro File @@ -150,8 +132,6 @@ private: bool m_userSetName; bool m_isUsingDyldImageSuffix; QString m_userWorkingDirectory; - QList<Utils::EnvironmentItem> m_userEnvironmentChanges; - BaseEnvironmentBase m_baseEnvironmentBase; bool m_parseSuccess; bool m_parseInProgress; }; @@ -173,21 +153,17 @@ private slots: void workDirectoryEdited(); void workingDirectoryReseted(); void argumentsEdited(const QString &arguments); - void userChangesEdited(); void environmentWasChanged(); void workingDirectoryChanged(const QString &workingDirectory); void commandLineArgumentsChanged(const QString &args); void runModeChanged(ProjectExplorer::LocalApplicationRunConfiguration::RunMode runMode); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges); - void baseEnvironmentChanged(); void effectiveTargetInformationChanged(); void termToggled(bool); void qvfbToggled(bool); void usingDyldImageSuffixToggled(bool); void usingDyldImageSuffixChanged(bool); - void baseEnvironmentSelected(int index); private: Qt4RunConfiguration *m_qt4RunConfiguration; @@ -201,10 +177,7 @@ private: QCheckBox *m_useQvfbCheck; QCheckBox *m_usingDyldImageSuffix; QLineEdit *m_qmlDebugPort; - - QComboBox *m_baseEnvironmentComboBox; Utils::DetailsWidget *m_detailsContainer; - ProjectExplorer::EnvironmentWidget *m_environmentWidget; bool m_isShown; }; diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp index c5e7f4806a..0ed4636539 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.cpp @@ -33,7 +33,6 @@ #include <projectexplorer/environmentaspect.h> #include <projectexplorer/target.h> #include <projectexplorer/project.h> -#include <projectexplorer/environmentwidget.h> #include <utils/detailswidget.h> #include <utils/pathchooser.h> @@ -83,36 +82,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE m_detailsContainer->setWidget(detailsWidget); detailsWidget->setLayout(layout); - 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); - vbox->addWidget(environmentLabel); - - QWidget *baseEnvironmentWidget = new QWidget; - QHBoxLayout *baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); - baseEnvironmentLayout->setMargin(0); - QLabel *label = new QLabel(tr("Base environment for this run configuration:"), this); - baseEnvironmentLayout->addWidget(label); - m_baseEnvironmentComboBox = new QComboBox(this); - m_baseEnvironmentComboBox->addItems(QStringList() - << tr("Clean Environment") - << tr("System Environment") - << tr("Build Environment")); - m_baseEnvironmentComboBox->setCurrentIndex(rc->baseEnvironmentBase()); - connect(m_baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(baseEnvironmentSelected(int))); - baseEnvironmentLayout->addWidget(m_baseEnvironmentComboBox); - baseEnvironmentLayout->addStretch(10); - - m_environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); - m_environmentWidget->setBaseEnvironment(rc->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(rc->baseEnvironmentText()); - m_environmentWidget->setUserChanges(rc->userEnvironmentChanges()); - vbox->addWidget(m_environmentWidget); - changed(); connect(m_executableChooser, SIGNAL(changed(QString)), @@ -131,29 +100,6 @@ CustomExecutableConfigurationWidget::CustomExecutableConfigurationWidget(CustomE } connect(m_runConfiguration, SIGNAL(changed()), this, SLOT(changed())); - - connect(m_environmentWidget, SIGNAL(userChangesChanged()), - this, SLOT(userChangesChanged())); - - connect(m_runConfiguration, SIGNAL(baseEnvironmentChanged()), - this, SLOT(baseEnvironmentChanged())); - connect(m_runConfiguration, SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), - this, SLOT(userEnvironmentChangesChanged())); -} - -void CustomExecutableConfigurationWidget::userChangesChanged() -{ - m_runConfiguration->setUserEnvironmentChanges(m_environmentWidget->userChanges()); -} - -void CustomExecutableConfigurationWidget::baseEnvironmentSelected(int index) -{ - m_ignoreChange = true; - m_runConfiguration->setBaseEnvironmentBase(CustomExecutableRunConfiguration::BaseEnvironmentBase(index)); - - m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); - m_ignoreChange = false; } void CustomExecutableConfigurationWidget::environmentWasChanged() @@ -165,24 +111,6 @@ void CustomExecutableConfigurationWidget::environmentWasChanged() m_executableChooser->setEnvironment(aspect->environment()); } -void CustomExecutableConfigurationWidget::baseEnvironmentChanged() -{ - if (m_ignoreChange) - return; - - int index = CustomExecutableRunConfiguration::BaseEnvironmentBase( - m_runConfiguration->baseEnvironmentBase()); - m_baseEnvironmentComboBox->setCurrentIndex(index); - m_environmentWidget->setBaseEnvironment(m_runConfiguration->baseEnvironment()); - m_environmentWidget->setBaseEnvironmentText(m_runConfiguration->baseEnvironmentText()); -} - -void CustomExecutableConfigurationWidget::userEnvironmentChangesChanged() -{ - m_environmentWidget->setUserChanges(m_runConfiguration->userEnvironmentChanges()); -} - - void CustomExecutableConfigurationWidget::executableEdited() { m_ignoreChange = true; diff --git a/src/plugins/qtsupport/customexecutableconfigurationwidget.h b/src/plugins/qtsupport/customexecutableconfigurationwidget.h index adcf6ed785..1850d0a550 100644 --- a/src/plugins/qtsupport/customexecutableconfigurationwidget.h +++ b/src/plugins/qtsupport/customexecutableconfigurationwidget.h @@ -45,7 +45,6 @@ class DetailsWidget; class PathChooser; } -namespace ProjectExplorer { class EnvironmentWidget; } namespace QtSupport { class CustomExecutableRunConfiguration; @@ -65,11 +64,6 @@ private slots: void argumentsEdited(const QString &arguments); void workingDirectoryEdited(); void termToggled(bool); - - void userChangesChanged(); - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(); - void baseEnvironmentSelected(int index); void environmentWasChanged(); private: @@ -79,8 +73,6 @@ private: QLineEdit *m_commandLineArgumentsLineEdit; Utils::PathChooser *m_workingDirectory; QCheckBox *m_useTerminalCheck; - ProjectExplorer::EnvironmentWidget *m_environmentWidget; - QComboBox *m_baseEnvironmentComboBox; Utils::DetailsWidget *m_detailsContainer; }; diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp index 921497dfd3..2b0526413e 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.cpp +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.cpp @@ -60,23 +60,17 @@ const char EXECUTABLE_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration. const char ARGUMENTS_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.Arguments"; const char WORKING_DIRECTORY_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.WorkingDirectory"; const char USE_TERMINAL_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.UseTerminal"; -const char USER_ENVIRONMENT_CHANGES_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.UserEnvironmentChanges"; -const char BASE_ENVIRONMENT_BASE_KEY[] = "ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase"; } void CustomExecutableRunConfiguration::ctor() { setDefaultDisplayName(defaultDisplayName()); - - connect(target(), SIGNAL(environmentChanged()), - this, SIGNAL(baseEnvironmentChanged())); } CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplorer::Target *parent) : ProjectExplorer::LocalApplicationRunConfiguration(parent, Core::Id(CUSTOM_EXECUTABLE_ID)), m_workingDirectory(QLatin1String(ProjectExplorer::Constants::DEFAULT_WORKING_DIR)), - m_runMode(Gui), - m_baseEnvironmentBase(CustomExecutableRunConfiguration::BuildEnvironmentBase) + m_runMode(Gui) { ctor(); } @@ -87,9 +81,7 @@ CustomExecutableRunConfiguration::CustomExecutableRunConfiguration(ProjectExplor m_executable(source->m_executable), m_workingDirectory(source->m_workingDirectory), m_cmdArguments(source->m_cmdArguments), - m_runMode(source->m_runMode), - m_userEnvironmentChanges(source->m_userEnvironmentChanges), - m_baseEnvironmentBase(source->m_baseEnvironmentBase) + m_runMode(source->m_runMode) { ctor(); } @@ -243,67 +235,6 @@ QString CustomExecutableRunConfiguration::rawCommandLineArguments() const return m_cmdArguments; } -QString CustomExecutableRunConfiguration::baseEnvironmentText() const -{ - if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { - return tr("Clean Environment"); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { - return tr("System Environment"); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { - return tr("Build Environment"); - } - return QString(); -} - -Utils::Environment CustomExecutableRunConfiguration::baseEnvironment() const -{ - Utils::Environment env; - if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::CleanEnvironmentBase) { - // Nothing - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::SystemEnvironmentBase) { - env = Utils::Environment::systemEnvironment(); - } else if (m_baseEnvironmentBase == CustomExecutableRunConfiguration::BuildEnvironmentBase) { - if (activeBuildConfiguration()) - env = activeBuildConfiguration()->environment(); - else - env = Utils::Environment::systemEnvironment(); // fall back - } - return env; -} - -void CustomExecutableRunConfiguration::setBaseEnvironmentBase(BaseEnvironmentBase env) -{ - if (m_baseEnvironmentBase == env) - return; - m_baseEnvironmentBase = env; - emit baseEnvironmentChanged(); -} - -CustomExecutableRunConfiguration::BaseEnvironmentBase CustomExecutableRunConfiguration::baseEnvironmentBase() const -{ - return m_baseEnvironmentBase; -} - -Utils::Environment CustomExecutableRunConfiguration::environment() const -{ - Utils::Environment env = baseEnvironment(); - env.modify(userEnvironmentChanges()); - return env; -} - -QList<Utils::EnvironmentItem> CustomExecutableRunConfiguration::userEnvironmentChanges() const -{ - return m_userEnvironmentChanges; -} - -void CustomExecutableRunConfiguration::setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff) -{ - if (m_userEnvironmentChanges != diff) { - m_userEnvironmentChanges = diff; - emit userEnvironmentChangesChanged(diff); - } -} - QString CustomExecutableRunConfiguration::defaultDisplayName() const { if (m_executable.isEmpty()) @@ -319,8 +250,6 @@ QVariantMap CustomExecutableRunConfiguration::toMap() const map.insert(QLatin1String(ARGUMENTS_KEY), m_cmdArguments); map.insert(QLatin1String(WORKING_DIRECTORY_KEY), m_workingDirectory); map.insert(QLatin1String(USE_TERMINAL_KEY), m_runMode == Console); - map.insert(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY), Utils::EnvironmentItem::toStringList(m_userEnvironmentChanges)); - map.insert(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(m_baseEnvironmentBase)); return map; } @@ -330,8 +259,6 @@ bool CustomExecutableRunConfiguration::fromMap(const QVariantMap &map) m_cmdArguments = map.value(QLatin1String(ARGUMENTS_KEY)).toString(); m_workingDirectory = map.value(QLatin1String(WORKING_DIRECTORY_KEY)).toString(); m_runMode = map.value(QLatin1String(USE_TERMINAL_KEY)).toBool() ? Console : Gui; - m_userEnvironmentChanges = Utils::EnvironmentItem::fromStringList(map.value(QLatin1String(USER_ENVIRONMENT_CHANGES_KEY)).toStringList()); - m_baseEnvironmentBase = static_cast<BaseEnvironmentBase>(map.value(QLatin1String(BASE_ENVIRONMENT_BASE_KEY), static_cast<int>(CustomExecutableRunConfiguration::BuildEnvironmentBase)).toInt()); setDefaultDisplayName(defaultDisplayName()); return LocalApplicationRunConfiguration::fromMap(map); diff --git a/src/plugins/qtsupport/customexecutablerunconfiguration.h b/src/plugins/qtsupport/customexecutablerunconfiguration.h index 312c6c04a0..78d5acd27f 100644 --- a/src/plugins/qtsupport/customexecutablerunconfiguration.h +++ b/src/plugins/qtsupport/customexecutablerunconfiguration.h @@ -34,8 +34,6 @@ #include <projectexplorer/localapplicationrunconfiguration.h> -#include <utils/environment.h> - #include <QVariantMap> namespace ProjectExplorer { class Target; } @@ -69,7 +67,6 @@ public: RunMode runMode() const; QString workingDirectory() const; QString commandLineArguments() const; - Utils::Environment environment() const; QWidget *createConfigurationWidget(); QString dumperLibrary() const; @@ -84,9 +81,6 @@ public: signals: void changed(); - void baseEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); - protected: CustomExecutableRunConfiguration(ProjectExplorer::Target *parent, CustomExecutableRunConfiguration *source); @@ -96,16 +90,6 @@ protected: private: void ctor(); - enum BaseEnvironmentBase { CleanEnvironmentBase = 0, - SystemEnvironmentBase = 1, - BuildEnvironmentBase = 2}; - void setBaseEnvironmentBase(BaseEnvironmentBase env); - BaseEnvironmentBase baseEnvironmentBase() const; - Utils::Environment baseEnvironment() const; - QString baseEnvironmentText() const; - void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); - QList<Utils::EnvironmentItem> userEnvironmentChanges() const; - void setExecutable(const QString &executable); QString rawExecutable() const; void setCommandLineArguments(const QString &commandLineArguments); @@ -122,8 +106,6 @@ private: RunMode m_runMode; bool m_userSetName; QString m_userName; - QList<Utils::EnvironmentItem> m_userEnvironmentChanges; - BaseEnvironmentBase m_baseEnvironmentBase; }; class CustomExecutableRunConfigurationFactory : public ProjectExplorer::IRunConfigurationFactory diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 4673839dc0..b691b790aa 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -48,9 +48,6 @@ namespace Internal { namespace { const char ArgumentsKey[] = "Qt4ProjectManager.MaemoRunConfiguration.Arguments"; const char ProFileKey[] = "Qt4ProjectManager.MaemoRunConfiguration.ProFile"; -const char BaseEnvironmentBaseKey[] = "Qt4ProjectManager.MaemoRunConfiguration.BaseEnvironmentBase"; -const char UserEnvironmentChangesKey[] - = "Qt4ProjectManager.MaemoRunConfiguration.UserEnvironmentChanges"; const char UseAlternateExeKey[] = "RemoteLinux.RunConfig.UseAlternateRemoteExecutable"; const char AlternateExeKey[] = "RemoteLinux.RunConfig.AlternateRemoteExecutable"; const char WorkingDirectoryKey[] = "RemoteLinux.RunConfig.WorkingDirectory"; @@ -61,7 +58,6 @@ class RemoteLinuxRunConfigurationPrivate { public: RemoteLinuxRunConfigurationPrivate(const QString &projectFilePath) : projectFilePath(projectFilePath), - baseEnvironmentType(RemoteLinuxRunConfiguration::RemoteBaseEnvironment), useAlternateRemoteExecutable(false) { } @@ -70,9 +66,6 @@ public: : projectFilePath(other->projectFilePath), gdbPath(other->gdbPath), arguments(other->arguments), - baseEnvironmentType(other->baseEnvironmentType), - remoteEnvironment(other->remoteEnvironment), - userEnvironmentChanges(other->userEnvironmentChanges), useAlternateRemoteExecutable(other->useAlternateRemoteExecutable), alternateRemoteExecutable(other->alternateRemoteExecutable), workingDirectory(other->workingDirectory) @@ -82,9 +75,6 @@ public: QString projectFilePath; QString gdbPath; QString arguments; - RemoteLinuxRunConfiguration::BaseEnvironmentType baseEnvironmentType; - Environment remoteEnvironment; - QList<EnvironmentItem> userEnvironmentChanges; QString disabledReason; bool useAlternateRemoteExecutable; QString alternateRemoteExecutable; @@ -159,9 +149,6 @@ QVariantMap RemoteLinuxRunConfiguration::toMap() const map.insert(QLatin1String(ArgumentsKey), d->arguments); const QDir dir = QDir(target()->project()->projectDirectory()); map.insert(QLatin1String(ProFileKey), dir.relativeFilePath(d->projectFilePath)); - map.insert(QLatin1String(BaseEnvironmentBaseKey), d->baseEnvironmentType); - map.insert(QLatin1String(UserEnvironmentChangesKey), - EnvironmentItem::toStringList(d->userEnvironmentChanges)); map.insert(QLatin1String(UseAlternateExeKey), d->useAlternateRemoteExecutable); map.insert(QLatin1String(AlternateExeKey), d->alternateRemoteExecutable); map.insert(QLatin1String(WorkingDirectoryKey), d->workingDirectory); @@ -177,11 +164,6 @@ bool RemoteLinuxRunConfiguration::fromMap(const QVariantMap &map) const QDir dir = QDir(target()->project()->projectDirectory()); d->projectFilePath = QDir::cleanPath(dir.filePath(map.value(QLatin1String(ProFileKey)).toString())); - d->userEnvironmentChanges = - EnvironmentItem::fromStringList(map.value(QLatin1String(UserEnvironmentChangesKey)) - .toStringList()); - d->baseEnvironmentType = static_cast<BaseEnvironmentType>(map.value(QLatin1String(BaseEnvironmentBaseKey), - RemoteBaseEnvironment).toInt()); d->useAlternateRemoteExecutable = map.value(QLatin1String(UseAlternateExeKey), false).toBool(); d->alternateRemoteExecutable = map.value(QLatin1String(AlternateExeKey)).toString(); d->workingDirectory = map.value(QLatin1String(WorkingDirectoryKey)).toString(); @@ -300,77 +282,6 @@ void RemoteLinuxRunConfiguration::handleBuildSystemDataUpdated() updateEnabledState(); } -QString RemoteLinuxRunConfiguration::baseEnvironmentText() const -{ - if (d->baseEnvironmentType == CleanBaseEnvironment) - return tr("Clean Environment"); - else if (d->baseEnvironmentType == RemoteBaseEnvironment) - return tr("System Environment"); - return QString(); -} - -RemoteLinuxRunConfiguration::BaseEnvironmentType RemoteLinuxRunConfiguration::baseEnvironmentType() const -{ - return d->baseEnvironmentType; -} - -void RemoteLinuxRunConfiguration::setBaseEnvironmentType(BaseEnvironmentType env) -{ - if (d->baseEnvironmentType != env) { - d->baseEnvironmentType = env; - emit baseEnvironmentChanged(); - } -} - -Environment RemoteLinuxRunConfiguration::environment() const -{ - Environment env = baseEnvironment(); - env.modify(userEnvironmentChanges()); - return env; -} - -Environment RemoteLinuxRunConfiguration::baseEnvironment() const -{ - return (d->baseEnvironmentType == RemoteBaseEnvironment ? remoteEnvironment() - : Environment()); -} - -QList<EnvironmentItem> RemoteLinuxRunConfiguration::userEnvironmentChanges() const -{ - return d->userEnvironmentChanges; -} - -QString RemoteLinuxRunConfiguration::userEnvironmentChangesAsString() const -{ - QString env; - QString placeHolder = QLatin1String("%1=%2 "); - foreach (const EnvironmentItem &item, userEnvironmentChanges()) - env.append(placeHolder.arg(item.name, item.value)); - return env.mid(0, env.size() - 1); -} - -void RemoteLinuxRunConfiguration::setUserEnvironmentChanges( - const QList<EnvironmentItem> &diff) -{ - if (d->userEnvironmentChanges != diff) { - d->userEnvironmentChanges = diff; - emit userEnvironmentChangesChanged(diff); - } -} - -Environment RemoteLinuxRunConfiguration::remoteEnvironment() const -{ - return d->remoteEnvironment; -} - -void RemoteLinuxRunConfiguration::setRemoteEnvironment(const Environment &environment) -{ - if (d->remoteEnvironment.size() == 0 || d->remoteEnvironment != environment) { - d->remoteEnvironment = environment; - emit remoteEnvironmentChanged(); - } -} - QString RemoteLinuxRunConfiguration::projectFilePath() const { return d->projectFilePath; diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.h b/src/plugins/remotelinux/remotelinuxrunconfiguration.h index 87a74b51bc..89fc7a0663 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.h +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.h @@ -33,7 +33,6 @@ #include "remotelinux_export.h" #include <projectexplorer/runconfiguration.h> -#include <utils/environment.h> namespace Utils { class PortList; } @@ -54,11 +53,6 @@ class REMOTELINUX_EXPORT RemoteLinuxRunConfiguration : public ProjectExplorer::R friend class RemoteLinuxRunConfigurationWidget; public: - enum BaseEnvironmentType { - CleanBaseEnvironment = 0, - RemoteBaseEnvironment = 1 - }; - enum DebuggingType { DebugCppOnly, DebugQmlOnly, DebugCppAndQml }; RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, const Core::Id id, @@ -87,13 +81,6 @@ public: QVariantMap toMap() const; - QString baseEnvironmentText() const; - BaseEnvironmentType baseEnvironmentType() const; - Utils::Environment environment() const; - Utils::Environment baseEnvironment() const; - QList<Utils::EnvironmentItem> userEnvironmentChanges() const; - Utils::Environment remoteEnvironment() const; - int portsUsedByDebuggers() const; QString projectFilePath() const; @@ -103,9 +90,6 @@ public: signals: void deploySpecsChanged(); void targetInformationChanged() const; - void baseEnvironmentChanged(); - void remoteEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &diff); protected: RemoteLinuxRunConfiguration(ProjectExplorer::Target *parent, @@ -113,7 +97,6 @@ protected: bool fromMap(const QVariantMap &map); QString defaultDisplayName(); void setDisabledReason(const QString &reason) const; - QString userEnvironmentChangesAsString() const; protected slots: void updateEnabledState() { emit enabledChanged(); } @@ -124,10 +107,6 @@ private slots: private: void init(); - void setBaseEnvironmentType(BaseEnvironmentType env); - void setUserEnvironmentChanges(const QList<Utils::EnvironmentItem> &diff); - void setRemoteEnvironment(const Utils::Environment &environment); - Internal::RemoteLinuxRunConfigurationPrivate * const d; }; diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp index aa2819ff7d..2b744daa2e 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.cpp @@ -29,9 +29,7 @@ #include "remotelinuxrunconfigurationwidget.h" #include "remotelinuxrunconfiguration.h" -#include "remotelinuxenvironmentreader.h" -#include <projectexplorer/environmentwidget.h> #include <utils/detailswidget.h> #include <QCoreApplication> @@ -47,22 +45,16 @@ namespace RemoteLinux { namespace Internal { -namespace { -const QString FetchEnvButtonText - = QCoreApplication::translate("RemoteLinux::RemoteLinuxRunConfigurationWidget", - "Fetch Device Environment"); -} // anonymous namespace class RemoteLinuxRunConfigurationWidgetPrivate { public: RemoteLinuxRunConfigurationWidgetPrivate(RemoteLinuxRunConfiguration *runConfig) - : runConfiguration(runConfig), deviceEnvReader(runConfiguration), ignoreChange(false) + : runConfiguration(runConfig), ignoreChange(false) { } RemoteLinuxRunConfiguration * const runConfiguration; - RemoteLinuxEnvironmentReader deviceEnvReader; bool ignoreChange; QWidget topWidget; @@ -75,9 +67,6 @@ public: QCheckBox useAlternateCommandBox; QLineEdit alternateCommand; QLabel devConfLabel; - QPushButton fetchEnvButton; - QComboBox baseEnvironmentComboBox; - ProjectExplorer::EnvironmentWidget *environmentWidget; QFormLayout genericWidgetsLayout; }; @@ -96,7 +85,6 @@ RemoteLinuxRunConfigurationWidget::RemoteLinuxRunConfigurationWidget(RemoteLinux QVBoxLayout *mainLayout = new QVBoxLayout(&d->topWidget); mainLayout->setMargin(0); addGenericWidgets(mainLayout); - addEnvironmentWidgets(mainLayout); connect(d->runConfiguration, SIGNAL(enabledChanged()), SLOT(runConfigurationEnabledChange())); @@ -181,43 +169,6 @@ void RemoteLinuxRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayou handleUseAlternateCommandChanged(); } -void RemoteLinuxRunConfigurationWidget::addEnvironmentWidgets(QVBoxLayout *mainLayout) -{ - QWidget * const baseEnvironmentWidget = new QWidget; - QHBoxLayout * const baseEnvironmentLayout = new QHBoxLayout(baseEnvironmentWidget); - baseEnvironmentLayout->setMargin(0); - QLabel * const label = new QLabel(tr("Base environment for this run configuration:"), this); - baseEnvironmentLayout->addWidget(label); - d->baseEnvironmentComboBox.addItems(QStringList() << tr("Clean Environment") - << tr("System Environment")); - d->baseEnvironmentComboBox.setCurrentIndex(d->runConfiguration->baseEnvironmentType()); - baseEnvironmentLayout->addWidget(&d->baseEnvironmentComboBox); - - d->fetchEnvButton.setText(FetchEnvButtonText); - baseEnvironmentLayout->addWidget(&d->fetchEnvButton); - baseEnvironmentLayout->addStretch(10); - - d->environmentWidget = new ProjectExplorer::EnvironmentWidget(this, baseEnvironmentWidget); - d->environmentWidget->setBaseEnvironment(d->deviceEnvReader.remoteEnvironment()); - d->environmentWidget->setBaseEnvironmentText(d->runConfiguration->baseEnvironmentText()); - d->environmentWidget->setUserChanges(d->runConfiguration->userEnvironmentChanges()); - mainLayout->addWidget(d->environmentWidget); - - connect(d->environmentWidget, SIGNAL(userChangesChanged()), SLOT(userChangesEdited())); - connect(&d->baseEnvironmentComboBox, SIGNAL(currentIndexChanged(int)), - this, SLOT(baseEnvironmentSelected(int))); - connect(d->runConfiguration, SIGNAL(baseEnvironmentChanged()), - this, SLOT(baseEnvironmentChanged())); - connect(d->runConfiguration, SIGNAL(remoteEnvironmentChanged()), - this, SLOT(remoteEnvironmentChanged())); - connect(d->runConfiguration, - SIGNAL(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>)), - SLOT(userEnvironmentChangesChanged(QList<Utils::EnvironmentItem>))); - connect(&d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); - connect(&d->deviceEnvReader, SIGNAL(finished()), this, SLOT(fetchEnvironmentFinished())); - connect(&d->deviceEnvReader, SIGNAL(error(QString)), SLOT(fetchEnvironmentError(QString))); -} - void RemoteLinuxRunConfigurationWidget::argumentsEdited(const QString &text) { d->runConfiguration->setArguments(text); @@ -262,70 +213,4 @@ void RemoteLinuxRunConfigurationWidget::handleWorkingDirectoryChanged() d->runConfiguration->setWorkingDirectory(d->workingDirLineEdit.text().trimmed()); } -void RemoteLinuxRunConfigurationWidget::fetchEnvironment() -{ - disconnect(&d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); - connect(&d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); - d->fetchEnvButton.setText(tr("Cancel Fetch Operation")); - d->deviceEnvReader.start(d->runConfiguration->environmentPreparationCommand()); -} - -void RemoteLinuxRunConfigurationWidget::stopFetchEnvironment() -{ - d->deviceEnvReader.stop(); - fetchEnvironmentFinished(); -} - -void RemoteLinuxRunConfigurationWidget::fetchEnvironmentFinished() -{ - disconnect(&d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(stopFetchEnvironment())); - connect(&d->fetchEnvButton, SIGNAL(clicked()), this, SLOT(fetchEnvironment())); - d->fetchEnvButton.setText(FetchEnvButtonText); - d->runConfiguration->setRemoteEnvironment(d->deviceEnvReader.remoteEnvironment()); -} - -void RemoteLinuxRunConfigurationWidget::fetchEnvironmentError(const QString &error) -{ - QMessageBox::warning(this, tr("Device Error"), - tr("Fetching environment failed: %1").arg(error)); -} - -void RemoteLinuxRunConfigurationWidget::userChangesEdited() -{ - d->ignoreChange = true; - d->runConfiguration->setUserEnvironmentChanges(d->environmentWidget->userChanges()); - d->ignoreChange = false; -} - -void RemoteLinuxRunConfigurationWidget::baseEnvironmentSelected(int index) -{ - d->ignoreChange = true; - d->runConfiguration->setBaseEnvironmentType(RemoteLinuxRunConfiguration::BaseEnvironmentType(index)); - d->environmentWidget->setBaseEnvironment(d->runConfiguration->baseEnvironment()); - d->environmentWidget->setBaseEnvironmentText(d->runConfiguration->baseEnvironmentText()); - d->ignoreChange = false; -} - -void RemoteLinuxRunConfigurationWidget::baseEnvironmentChanged() -{ - if (d->ignoreChange) - return; - - d->baseEnvironmentComboBox.setCurrentIndex(d->runConfiguration->baseEnvironmentType()); - d->environmentWidget->setBaseEnvironment(d->runConfiguration->baseEnvironment()); - d->environmentWidget->setBaseEnvironmentText(d->runConfiguration->baseEnvironmentText()); -} - -void RemoteLinuxRunConfigurationWidget::remoteEnvironmentChanged() -{ - d->environmentWidget->setBaseEnvironment(d->runConfiguration->remoteEnvironment()); -} - -void RemoteLinuxRunConfigurationWidget::userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges) -{ - if (d->ignoreChange) - return; - d->environmentWidget->setUserChanges(userChanges); -} - } // namespace RemoteLinux diff --git a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h index 704430573c..c0470d627c 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h +++ b/src/plugins/remotelinux/remotelinuxrunconfigurationwidget.h @@ -38,8 +38,6 @@ class QLabel; class QVBoxLayout; QT_END_NAMESPACE -namespace Utils { class EnvironmentItem; } - namespace RemoteLinux { class RemoteLinuxRunConfiguration; @@ -63,15 +61,6 @@ public: private slots: void argumentsEdited(const QString &args); void updateTargetInformation(); - void fetchEnvironment(); - void fetchEnvironmentFinished(); - void fetchEnvironmentError(const QString &error); - void stopFetchEnvironment(); - void userChangesEdited(); - void baseEnvironmentSelected(int index); - void baseEnvironmentChanged(); - void remoteEnvironmentChanged(); - void userEnvironmentChangesChanged(const QList<Utils::EnvironmentItem> &userChanges); void handleDeploySpecsChanged(); void handleUseAlternateCommandChanged(); void handleAlternateCommandChanged(); @@ -79,7 +68,6 @@ private slots: private: void addGenericWidgets(QVBoxLayout *mainLayout); - void addEnvironmentWidgets(QVBoxLayout *mainLayout); void setLabelText(QLabel &label, const QString ®ularText, const QString &errorText); Internal::RemoteLinuxRunConfigurationWidgetPrivate * const d; |