Commit c4c5cbd6 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix save effect stack broken if there is only 1 effect in the stack

parent d38f885b
Pipeline #205805 canceled with stage
in 6 minutes and 42 seconds
......@@ -87,17 +87,16 @@ public slots:
void blockWheelEvent(bool block);
/** @brief Switch between collapsed/expanded state */
void switchCollapsed(int row);
/** @brief Open a save effect dialog */
void slotSaveEffect();
private slots:
void setWidgetHeight(qreal value);
void enableView(bool enabled);
private slots:
void slotSwitch(bool expand);
void slotDeleteEffect();
void slotEffectUp();
void slotEffectDown();
void slotSaveEffect();
void slotCreateGroup();
void slotCreateRegion();
void slotUnGroup();
......
......@@ -492,7 +492,17 @@ void EffectStackView::slotFocusEffect()
void EffectStackView::slotSaveStack()
{
if (m_model->rowCount() <= 0) {
if (m_model->rowCount() == 1) {
int currentActive = m_model->getActiveEffect();
if (currentActive > -1) {
auto item = m_model->getEffectStackRow(currentActive);
QModelIndex ix = m_model->getIndexFromItem(item);
auto *w = static_cast<CollapsibleEffectView *>(m_effectsTree->indexWidget(ix));
w->slotSaveEffect();
return;
}
}
if (m_model->rowCount() <= 1) {
KMessageBox::sorry(this, i18n("No effect selected."));
return;
}
......
Supports Markdown
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