Skip to content

Commit

Permalink
Remove some Qt4 compatibility code
Browse files Browse the repository at this point in the history
  • Loading branch information
PhysSong committed Mar 26, 2019
1 parent f18efb4 commit 4dce466
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 45 deletions.
17 changes: 0 additions & 17 deletions include/Model.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ class LMMS_EXPORT Model : public QObject
m_displayName( _display_name ),
m_defaultConstructed( _default_constructed )
{
#if QT_VERSION < 0x050000
connect( this, SIGNAL( dataChanged() ), this,
SLOT( thisDataChanged() ), Qt::DirectConnection );
#endif
}

virtual ~Model()
Expand Down Expand Up @@ -89,19 +85,6 @@ class LMMS_EXPORT Model : public QObject
// emitted if properties of the model (e.g. ranges) have changed
void propertiesChanged();

#if QT_VERSION < 0x050000
// emitted along with dataChanged(), but with this model as an argument
// workaround for when QObject::sender() and Qt5 are unavailable
void dataChanged( Model * );

private slots:
void thisDataChanged()
{
emit dataChanged( this );
}

signals:
#endif
} ;


Expand Down
10 changes: 0 additions & 10 deletions plugins/VstEffect/VstEffectControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,8 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
knobFModel[ i ]->setInitValue(LocaleHelper::toFloat(s_dumpValues.at(2)));
}

#if QT_VERSION < 0x050000
connect( knobFModel[i], SIGNAL( dataChanged( Model * ) ),
this, SLOT( setParameter( Model * ) ), Qt::DirectConnection );
#else
connect( knobFModel[i], &FloatModel::dataChanged, this,
[this, i]() { setParameter( knobFModel[i] ); }, Qt::DirectConnection);
#endif
}

}
Expand Down Expand Up @@ -383,13 +378,8 @@ manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls *
}

FloatModel * model = m_vi->knobFModel[i];
#if QT_VERSION < 0x050000
connect( model, SIGNAL( dataChanged( Model * ) ), this,
SLOT( setParameter( Model * ) ), Qt::DirectConnection );
#else
connect( model, &FloatModel::dataChanged, this,
[this, model]() { setParameter( model ); }, Qt::DirectConnection);
#endif
vstKnobs[ i ] ->setModel( model );
}

Expand Down
10 changes: 0 additions & 10 deletions plugins/vestige/vestige.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,8 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
knobFModel[ i ]->setInitValue(LocaleHelper::toFloat(s_dumpValues.at(2)));
}

#if QT_VERSION < 0x050000
connect( knobFModel[i], SIGNAL( dataChanged( Model * ) ),
this, SLOT( setParameter( Model * ) ), Qt::DirectConnection );
#else
connect( knobFModel[i], &FloatModel::dataChanged, this,
[this, i]() { setParameter( knobFModel[i] ); }, Qt::DirectConnection);
#endif
}
}
m_pluginMutex.unlock();
Expand Down Expand Up @@ -984,13 +979,8 @@ manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrume
}

FloatModel * model = m_vi->knobFModel[i];
#if QT_VERSION < 0x050000
connect( model, SIGNAL( dataChanged( Model * ) ), this,
SLOT( setParameter( Model * ) ), Qt::DirectConnection );
#else
connect( model, &FloatModel::dataChanged, this,
[this, model]() { setParameter( model ); }, Qt::DirectConnection);
#endif
vstKnobs[i] ->setModel( model );
}

Expand Down
3 changes: 0 additions & 3 deletions plugins/zynaddsubfx/ZynAddSubFx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,7 @@ void ZynAddSubFxInstrument::loadSettings( const QDomElement & _this )

emit settingsChanged();
}
// FIXME: Remove this check in future versions. Slots are public in Qt5+
#if QT_VERSION >= 0x050000
emit instrumentTrack()->pitchModel()->dataChanged();
#endif
}


Expand Down
5 changes: 0 additions & 5 deletions src/gui/SetupDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,12 +1075,7 @@ void SetupDialog::toggleOneInstrumentTrackWindow( bool _enabled )

void SetupDialog::vstEmbedMethodChanged()
{
#if QT_VERSION >= 0x050000
m_vstEmbedMethod = m_vstEmbedComboBox->currentData().toString();
#else
m_vstEmbedMethod = m_vstEmbedComboBox->itemData(
m_vstEmbedComboBox->currentIndex()).toString();
#endif
m_vstAlwaysOnTopCheckBox->setVisible( m_vstEmbedMethod == "none" );
}

Expand Down

0 comments on commit 4dce466

Please sign in to comment.