Commit f133ca30 authored by Tobias Hunger's avatar Tobias Hunger
Browse files

TargetSettingsPanel: Remove unnecessary method



Clean up the necessary one a little bit.

Change-Id: Iba62b507461297c669b96a549714c117d385b518
Reviewed-by: default avatarNiels Weber <niels.weber@theqtcompany.com>
parent e404aa2e
...@@ -339,11 +339,7 @@ void TargetSettingsPanelWidget::addActionTriggered(QAction *action) ...@@ -339,11 +339,7 @@ void TargetSettingsPanelWidget::addActionTriggered(QAction *action)
void TargetSettingsPanelWidget::removeTarget() void TargetSettingsPanelWidget::removeTarget()
{ {
Target *t = m_targets.at(m_menuTargetIndex); Target *t = m_targets.at(m_menuTargetIndex);
removeTarget(t);
}
void TargetSettingsPanelWidget::removeTarget(Target *t)
{
if (BuildManager::isBuilding(t)) { if (BuildManager::isBuilding(t)) {
QMessageBox box; QMessageBox box;
QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Kit"), QMessageBox::AcceptRole); QPushButton *closeAnyway = box.addButton(tr("Cancel Build && Remove Kit"), QMessageBox::AcceptRole);
...@@ -465,11 +461,11 @@ void TargetSettingsPanelWidget::updateTargetButtons() ...@@ -465,11 +461,11 @@ void TargetSettingsPanelWidget::updateTargetButtons()
if (m_project->targets().size() < 2) if (m_project->targets().size() < 2)
removeAction->setEnabled(false); removeAction->setEnabled(false);
connect(m_changeMenu, SIGNAL(triggered(QAction*)), connect(m_changeMenu, &QMenu::triggered,
this, SLOT(changeActionTriggered(QAction*))); this, &TargetSettingsPanelWidget::changeActionTriggered);
connect(m_duplicateMenu, SIGNAL(triggered(QAction*)), connect(m_duplicateMenu, &QMenu::triggered,
this, SLOT(duplicateActionTriggered(QAction*))); this, &TargetSettingsPanelWidget::duplicateActionTriggered);
connect(removeAction, SIGNAL(triggered()), this, SLOT(removeTarget())); connect(removeAction, &QAction::triggered, this, &TargetSettingsPanelWidget::removeTarget);
foreach (Kit *k, KitManager::sortKits(KitManager::kits())) { foreach (Kit *k, KitManager::sortKits(KitManager::kits())) {
if (m_project->target(k)) if (m_project->target(k))
...@@ -524,7 +520,7 @@ void TargetSettingsPanelWidget::importTarget(const Utils::FileName &path) ...@@ -524,7 +520,7 @@ void TargetSettingsPanelWidget::importTarget(const Utils::FileName &path)
foreach (BuildInfo *info, toImport) { foreach (BuildInfo *info, toImport) {
target = m_project->target(info->kitId); target = m_project->target(info->kitId);
if (!target) { if (!target) {
target = new Target(m_project, KitManager::find(info->kitId)); target = m_project->createTarget(KitManager::find(info->kitId));
m_project->addTarget(target); m_project->addTarget(target);
} }
bc = info->factory()->create(target, info); bc = info->factory()->create(target, info);
......
...@@ -84,7 +84,6 @@ private slots: ...@@ -84,7 +84,6 @@ private slots:
void changeActionTriggered(QAction *action); void changeActionTriggered(QAction *action);
void duplicateActionTriggered(QAction *action); void duplicateActionTriggered(QAction *action);
private: private:
void removeTarget(Target *t);
void importTarget(const Utils::FileName &path); void importTarget(const Utils::FileName &path);
void createAction(Kit *k, QMenu *menu); void createAction(Kit *k, QMenu *menu);
......
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