Commit ae95074b authored by Tobias Hunger's avatar Tobias Hunger

MiniProjectTargetSelector: Simplify code

Change-Id: Ie28efa6deb29801dd670656eeeeef81ccc4ae87f
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 96df9f91
......@@ -719,13 +719,23 @@ MiniProjectTargetSelector::MiniProjectTargetSelector(QAction *targetSelectorActi
this, &MiniProjectTargetSelector::kitChanged);
connect(m_listWidgets[TARGET], &GenericListWidget::changeActiveProjectConfiguration,
this, &MiniProjectTargetSelector::setActiveTarget);
this, [this](ProjectConfiguration *pc) {
SessionManager::setActiveTarget(m_project, static_cast<Target *>(pc), SetActive::Cascade);
});
connect(m_listWidgets[BUILD], &GenericListWidget::changeActiveProjectConfiguration,
this, &MiniProjectTargetSelector::setActiveBuildConfiguration);
this, [this](ProjectConfiguration *pc) {
SessionManager::setActiveBuildConfiguration(m_project->activeTarget(),
static_cast<BuildConfiguration *>(pc), SetActive::Cascade);
});
connect(m_listWidgets[DEPLOY], &GenericListWidget::changeActiveProjectConfiguration,
this, &MiniProjectTargetSelector::setActiveDeployConfiguration);
this, [this](ProjectConfiguration *pc) {
SessionManager::setActiveDeployConfiguration(m_project->activeTarget(),
static_cast<DeployConfiguration *>(pc), SetActive::Cascade);
});
connect(m_listWidgets[RUN], &GenericListWidget::changeActiveProjectConfiguration,
this, &MiniProjectTargetSelector::setActiveRunConfiguration);
this, [this](ProjectConfiguration *pc) {
m_project->activeTarget()->setActiveRunConfiguration(static_cast<RunConfiguration *>(pc));
});
}
bool MiniProjectTargetSelector::event(QEvent *event)
......@@ -959,27 +969,6 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
move(moveTo);
}
void MiniProjectTargetSelector::setActiveTarget(ProjectConfiguration *pc)
{
SessionManager::setActiveTarget(m_project, static_cast<Target *>(pc),
SetActive::Cascade);
}
void MiniProjectTargetSelector::setActiveBuildConfiguration(ProjectConfiguration *pc)
{
SessionManager::setActiveBuildConfiguration(m_target, static_cast<BuildConfiguration *>(pc), SetActive::Cascade);
}
void MiniProjectTargetSelector::setActiveDeployConfiguration(ProjectConfiguration *pc)
{
SessionManager::setActiveDeployConfiguration(m_target, static_cast<DeployConfiguration *>(pc), SetActive::Cascade);
}
void MiniProjectTargetSelector::setActiveRunConfiguration(ProjectConfiguration *pc)
{
m_target->setActiveRunConfiguration(static_cast<RunConfiguration *>(pc));
}
void MiniProjectTargetSelector::projectAdded(Project *project)
{
connect(project, &Project::addedTarget,
......
......@@ -164,11 +164,6 @@ private:
void activeDeployConfigurationChanged(ProjectExplorer::DeployConfiguration *dc);
void activeRunConfigurationChanged(ProjectExplorer::RunConfiguration *rc);
void setActiveTarget(ProjectExplorer::ProjectConfiguration *pc);
void setActiveBuildConfiguration(ProjectExplorer::ProjectConfiguration *pc);
void setActiveDeployConfiguration(ProjectExplorer::ProjectConfiguration *pc);
void setActiveRunConfiguration(ProjectExplorer::ProjectConfiguration *pc);
void delayedHide();
void updateActionAndSummary();
void switchToProjectsMode();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment