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

CMake: Fix clean target



Always list a "all" and "clean" targets and remove the similar code
in the tealeaf reader.

This fixes the clean-step falling back to "all" in server-mode.

Task-number: QTCREATORBUG-17138
Change-Id: I1ce84f03c2e9829e4bb5f550c10cdef772fabf5b
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 5605337f
......@@ -444,19 +444,26 @@ QString CMakeBuildStepConfigWidget::displayName() const
return tr("Build", "CMakeProjectManager::CMakeBuildStepConfigWidget display name.");
}
void CMakeBuildStepConfigWidget::buildTargetsChanged()
static void createSpecialItem(const QString &text, const QString &data, QListWidget *parent)
{
const bool wasBlocked = m_buildTargetsList->blockSignals(true);
m_buildTargetsList->clear();
auto item = new QListWidgetItem(text, parent);
auto item = new QListWidgetItem(tr(ADD_RUNCONFIGURATION_TEXT), m_buildTargetsList);
item->setData(Qt::UserRole, QString::fromLatin1(ADD_RUNCONFIGURATION_TEXT));
item->setData(Qt::UserRole, data);
QFont f;
f.setItalic(true);
item->setFont(f);
}
void CMakeBuildStepConfigWidget::buildTargetsChanged()
{
const bool wasBlocked = m_buildTargetsList->blockSignals(true);
m_buildTargetsList->clear();
createSpecialItem(tr(ADD_RUNCONFIGURATION_TEXT), ADD_RUNCONFIGURATION_TEXT, m_buildTargetsList);
createSpecialItem(tr("all"), "all", m_buildTargetsList);
createSpecialItem(tr("clean"), "clean", m_buildTargetsList);
CMakeProject *pro = static_cast<CMakeProject *>(m_buildStep->project());
auto pro = static_cast<CMakeProject *>(m_buildStep->project());
QStringList targetList = pro->buildTargetTitles();
targetList.sort();
......
......@@ -180,15 +180,6 @@ bool CMakeCbpParser::parseCbpFile(CMakeTool::PathMapper mapper, const FileName &
fi.close();
// There is always a clean target:
CMakeBuildTarget cleanTarget;
cleanTarget.title = "clean";
cleanTarget.targetType = UtilityType;
cleanTarget.workingDirectory = m_buildDirectory;
cleanTarget.sourceDirectory = m_sourceDirectory;
m_buildTargets.append(cleanTarget);
return true;
}
return false;
......
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