summaryrefslogtreecommitdiff
path: root/src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@digia.com>2013-01-29 18:01:47 +0100
committerTobias Hunger <tobias.hunger@digia.com>2013-04-11 15:15:18 +0200
commit41804ac884f8ca857785b50cb3256df95195ff8b (patch)
tree49136684bd4663c27253d53bda99d5387e29eb34 /src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp
parent87347bb064f81f9f7727bf8800b0964d57d34c22 (diff)
downloadqt-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>
Diffstat (limited to 'src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp')
-rw-r--r--src/plugins/qt4projectmanager/qt-desktop/qt4runconfiguration.cpp173
1 files changed, 1 insertions, 172 deletions
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());