Commit 8f0ae230 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Fix regression and crash in effect focusing

parent b5a51256
Pipeline #15566 passed with stage
in 17 minutes and 6 seconds
......@@ -202,9 +202,9 @@ void EffectStackView::setModel(std::shared_ptr<EffectStackModel> model, const QS
void EffectStackView::loadEffects()
{
qDebug() << "MUTEX LOCK!!!!!!!!!!!! loadEffects: ";
//QMutexLocker lock(&m_mutex);
int max = m_model->rowCount();
qDebug() << "MUTEX LOCK!!!!!!!!!!!! loadEffects COUNT: "<<max;
if (max == 0) {
// blank stack
ObjectId item = m_model->getOwnerId();
......@@ -249,10 +249,10 @@ void EffectStackView::loadEffects()
activeIndex = ix;
}
}
updateTreeHeight();
if (activeIndex.isValid()) {
doActivateEffect(active, activeIndex);
doActivateEffect(active, activeIndex, true);
}
updateTreeHeight();
qDebug() << "MUTEX UNLOCK!!!!!!!!!!!! loadEffects";
}
......@@ -411,14 +411,14 @@ void EffectStackView::switchCollapsed()
}
}
void EffectStackView::doActivateEffect(int row, QModelIndex activeIx)
void EffectStackView::doActivateEffect(int row, QModelIndex activeIx, bool force)
{
int currentActive = m_model->getActiveEffect();
if (row > 0 && row == currentActive) {
if (row == currentActive && !force) {
// Effect is already active
return;
}
if (row != currentActive) {
if (row != currentActive && currentActive > -1) {
auto item = m_model->getEffectStackRow(currentActive);
QModelIndex ix = m_model->getIndexFromItem(item);
CollapsibleEffectView *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
......
......@@ -104,7 +104,7 @@ private slots:
void slotActivateEffect(const std::shared_ptr<EffectItemModel> &effectModel);
void loadEffects();
void updateTreeHeight();
void doActivateEffect(int row, QModelIndex ix);
void doActivateEffect(int row, QModelIndex ix, bool force = false);
// void switchBuiltStack(bool show);
......
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