Skip to content

Commit

Permalink
Move connection to setEffectParameterSlot() to avoid double connection
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer committed Nov 2, 2022
1 parent febc702 commit 6e889b3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/widget/weffectparameternamebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ void WEffectParameterNameBase::setEffectParameterSlot(
&EffectParameterSlotBase::updated,
this,
&WEffectParameterNameBase::parameterUpdated);
if (qobject_cast<EffectKnobParameterSlot*>(m_pParameterSlot.data())) {
// Make connection to show parameter value instead of name briefly
// after value has changed.
connect(m_pParameterSlot.data(),
&EffectParameterSlotBase::valueChanged,
this,
&WEffectParameterNameBase::showNewValue);
}
}
parameterUpdated();
}
Expand All @@ -49,14 +57,6 @@ void WEffectParameterNameBase::parameterUpdated() {
setBaseTooltip(QString("%1\n%2").arg(
m_pParameterSlot->name(),
m_pParameterSlot->description()));
// Make connection to show parameter value instead of name briefly
// after value has changed.
if (m_pParameterSlot->parameterType() == EffectParameterType::Knob) {
connect(m_pParameterSlot.data(),
&EffectParameterSlotBase::valueChanged,
this,
&WEffectParameterNameBase::showNewValue);
}
} else {
m_text = kNoEffectString;
setBaseTooltip(tr("No effect loaded."));
Expand Down

0 comments on commit 6e889b3

Please sign in to comment.