summaryrefslogtreecommitdiff
path: root/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@nokia.com>2012-04-24 15:49:09 +0200
committerTobias Hunger <tobias.hunger@nokia.com>2012-06-21 12:08:12 +0200
commit24314562165588b56a318b3b8a846bf5deda7c41 (patch)
treeb5dcf951e76d003c2623011b0e91994e06e7e061 /src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
parent8c77b8c9d7b25d0c89003c8c4a54e8da5bfb7edd (diff)
downloadqt-creator-24314562165588b56a318b3b8a846bf5deda7c41.tar.gz
Profile introduction
Introduce Profiles to store sets of values that describe a system/device. These profiles are held by a target, getting rid of much of the information stored in the Build-/Run-/DeployConfigurations, greatly simplifying those. This is a squash of the wip/profile branch which has been on gerrit for a while, rebased to current master. Change-Id: I25956c8dd4d1962b2134bfaa8a8076ae3909460f Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
Diffstat (limited to 'src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp')
-rw-r--r--src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp59
1 files changed, 3 insertions, 56 deletions
diff --git a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
index 72ed2dc159..9f8315c4cd 100644
--- a/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
+++ b/src/plugins/autotoolsprojectmanager/autotoolsbuildsettingswidget.cpp
@@ -37,7 +37,7 @@
#include "autotoolsbuildconfiguration.h"
#include <projectexplorer/projectexplorer.h>
-#include <projectexplorer/toolchainmanager.h>
+#include <projectexplorer/target.h>
#include <QGridLayout>
#include <QLabel>
@@ -50,10 +50,7 @@ using namespace AutotoolsProjectManager;
using namespace AutotoolsProjectManager::Internal;
using namespace ProjectExplorer;
-AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsTarget *target) :
- m_target(target),
- m_pathChooser(0),
- m_toolChainChooser(0),
+AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget() :
m_buildConfiguration(0)
{
QFormLayout *fl = new QFormLayout(this);
@@ -63,23 +60,8 @@ AutotoolsBuildSettingsWidget::AutotoolsBuildSettingsWidget(AutotoolsTarget *targ
m_pathChooser = new Utils::PathChooser(this);
m_pathChooser->setEnabled(true);
m_pathChooser->setExpectedKind(Utils::PathChooser::Directory);
- m_pathChooser->setBaseDirectory(m_target->autotoolsProject()->projectDirectory());
fl->addRow(tr("Build directory:"), m_pathChooser);
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
-
- // tool chain
- m_toolChainChooser = new QComboBox;
- m_toolChainChooser->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
- updateToolChainList();
-
- fl->addRow(tr("Tool chain:"), m_toolChainChooser);
- connect(m_toolChainChooser, SIGNAL(activated(int)), this, SLOT(toolChainSelected(int)));
- connect(m_target->autotoolsProject(), SIGNAL(toolChainChanged(ProjectExplorer::ToolChain*)),
- this, SLOT(toolChainChanged(ProjectExplorer::ToolChain*)));
- connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
- this, SLOT(updateToolChainList()));
- connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
- this, SLOT(updateToolChainList()));
}
QString AutotoolsBuildSettingsWidget::displayName() const
@@ -90,6 +72,7 @@ QString AutotoolsBuildSettingsWidget::displayName() const
void AutotoolsBuildSettingsWidget::init(BuildConfiguration *bc)
{
m_buildConfiguration = static_cast<AutotoolsBuildConfiguration *>(bc);
+ m_pathChooser->setBaseDirectory(bc->target()->project()->projectDirectory());
m_pathChooser->setPath(m_buildConfiguration->buildDirectory());
}
@@ -97,39 +80,3 @@ void AutotoolsBuildSettingsWidget::buildDirectoryChanged()
{
m_buildConfiguration->setBuildDirectory(m_pathChooser->rawPath());
}
-
-void AutotoolsBuildSettingsWidget::toolChainSelected(int index)
-{
- using namespace ProjectExplorer;
-
- ToolChain *tc = static_cast<ToolChain *>(m_toolChainChooser->itemData(index).value<void *>());
- m_target->autotoolsProject()->setToolChain(tc);
-}
-
-void AutotoolsBuildSettingsWidget::toolChainChanged(ProjectExplorer::ToolChain *tc)
-{
- for (int i = 0; i < m_toolChainChooser->count(); ++i) {
- ToolChain *currentTc = static_cast<ToolChain *>(m_toolChainChooser->itemData(i).value<void *>());
- if (currentTc != tc)
- continue;
- m_toolChainChooser->setCurrentIndex(i);
- return;
- }
-}
-
-void AutotoolsBuildSettingsWidget::updateToolChainList()
-{
- m_toolChainChooser->clear();
-
- QList<ToolChain *> tcs = ToolChainManager::instance()->toolChains();
- if (!m_target->autotoolsProject()->toolChain()) {
- m_toolChainChooser->addItem(tr("<Invalid tool chain>"), qVariantFromValue(static_cast<void *>(0)));
- m_toolChainChooser->setCurrentIndex(0);
- }
- foreach (ToolChain *tc, tcs) {
- m_toolChainChooser->addItem(tc->displayName(), qVariantFromValue(static_cast<void *>(tc)));
- if (m_target->autotoolsProject()->toolChain()
- && m_target->autotoolsProject()->toolChain()->id() == tc->id())
- m_toolChainChooser->setCurrentIndex(m_toolChainChooser->count() - 1);
- }
-}