forked from qt-creator/qt-creator
Fix reordering of build steps in the clean list
* Fix reordering of build steps in the clean list of steps. * Make the code more robust and avoid removing and inserting the item. * Update code for the build steps list too for reasons of symetry. Reviewed-by: dt
This commit is contained in:
@@ -143,8 +143,10 @@ void BuildConfiguration::removeBuildStep(int position)
|
|||||||
|
|
||||||
void BuildConfiguration::moveBuildStepUp(int position)
|
void BuildConfiguration::moveBuildStepUp(int position)
|
||||||
{
|
{
|
||||||
BuildStep *bs = m_buildSteps.takeAt(position);
|
if (position <= 0 || m_buildSteps.size() <= 1)
|
||||||
m_buildSteps.insert(position - 1, bs);
|
return;
|
||||||
|
m_buildSteps.swap(position - 1, position);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<BuildStep *> BuildConfiguration::cleanSteps() const
|
QList<BuildStep *> BuildConfiguration::cleanSteps() const
|
||||||
@@ -165,8 +167,9 @@ void BuildConfiguration::removeCleanStep(int position)
|
|||||||
|
|
||||||
void BuildConfiguration::moveCleanStepUp(int position)
|
void BuildConfiguration::moveCleanStepUp(int position)
|
||||||
{
|
{
|
||||||
BuildStep *cs = m_cleanSteps.takeAt(position);
|
if (position <= 0 || m_cleanSteps.size() <= 1)
|
||||||
m_cleanSteps.insert(position, cs);
|
return;
|
||||||
|
m_cleanSteps.swap(position - 1, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
Reference in New Issue
Block a user