forked from qt-creator/qt-creator
ProjectExplorer: Move configWidget from Project to Target
Reviewed-By: hunger
This commit is contained in:
@@ -393,11 +393,6 @@ QList<ProjectExplorer::Project *> GenericProject::dependsOn()
|
||||
return QList<Project *>();
|
||||
}
|
||||
|
||||
ProjectExplorer::BuildConfigWidget *GenericProject::createConfigWidget()
|
||||
{
|
||||
return new GenericBuildSettingsWidget(this);
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::BuildConfigWidget*> GenericProject::subConfigWidgets()
|
||||
{
|
||||
QList<ProjectExplorer::BuildConfigWidget*> list;
|
||||
@@ -468,8 +463,8 @@ bool GenericProject::fromMap(const QVariantMap &map)
|
||||
// GenericBuildSettingsWidget
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
||||
: m_project(project), m_buildConfiguration(0)
|
||||
GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericTarget *target)
|
||||
: m_target(target), m_buildConfiguration(0)
|
||||
{
|
||||
QFormLayout *fl = new QFormLayout(this);
|
||||
fl->setContentsMargins(0, -1, 0, -1);
|
||||
@@ -478,7 +473,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
||||
// build directory
|
||||
m_pathChooser = new Utils::PathChooser(this);
|
||||
m_pathChooser->setEnabled(true);
|
||||
m_pathChooser->setBaseDirectory(project->projectDirectory());
|
||||
m_pathChooser->setBaseDirectory(m_target->genericProject()->projectDirectory());
|
||||
fl->addRow(tr("Build directory:"), m_pathChooser);
|
||||
connect(m_pathChooser, SIGNAL(changed(QString)), this, SLOT(buildDirectoryChanged()));
|
||||
|
||||
@@ -490,7 +485,7 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericProject *project)
|
||||
int selectedIndex = -1;
|
||||
foreach (ToolChainType tc, ToolChain::supportedToolChains()) {
|
||||
toolChainChooser->addItem(ToolChain::toolChainName(tc), QVariant::fromValue<ToolChainType>(tc));
|
||||
if (m_project->toolChainType() == tc)
|
||||
if (m_target->genericProject()->toolChainType() == tc)
|
||||
selectedIndex = index;
|
||||
++index;
|
||||
}
|
||||
@@ -523,7 +518,7 @@ void GenericBuildSettingsWidget::toolChainSelected(int index)
|
||||
|
||||
QComboBox *toolChainChooser = qobject_cast<QComboBox*>(sender());
|
||||
ToolChainType type = toolChainChooser->itemData(index).value<ToolChainType>();
|
||||
m_project->setToolChainType(type);
|
||||
m_target->genericProject()->setToolChainType(type);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Reference in New Issue
Block a user