Remove remaining usages of QSignalMapper
This commit is contained in:
@@ -46,7 +46,6 @@ class QPixmap;
|
||||
class QScrollBar;
|
||||
class QString;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class ComboBox;
|
||||
class NotePlayHandle;
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include <QtCore/QVector>
|
||||
#include <QtCore/QList>
|
||||
#include <QWidget>
|
||||
#include <QSignalMapper>
|
||||
#include <QColor>
|
||||
#include <QMimeData>
|
||||
|
||||
|
||||
@@ -1239,6 +1239,7 @@ void InstrumentTrackView::muteChanged()
|
||||
|
||||
|
||||
|
||||
//FIXME: This is identical to SampleTrackView::createFxMenu
|
||||
QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
{
|
||||
int channelIndex = model()->effectChannelModel()->value();
|
||||
@@ -1253,8 +1254,6 @@ QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
QMenu *fxMenu = new QMenu( title );
|
||||
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(fxMenu);
|
||||
|
||||
fxMenu->addAction( newFxLabel, this, SLOT( createFxLine() ) );
|
||||
fxMenu->addSeparator();
|
||||
|
||||
@@ -1264,14 +1263,14 @@ QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
if ( currentChannel != fxChannel )
|
||||
{
|
||||
auto index = currentChannel->m_channelIndex;
|
||||
QString label = tr( "FX %1: %2" ).arg( currentChannel->m_channelIndex ).arg( currentChannel->m_name );
|
||||
QAction * action = fxMenu->addAction( label, fxMenuSignalMapper, SLOT( map() ) );
|
||||
fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex);
|
||||
fxMenu->addAction(label, [this, index](){
|
||||
assignFxLine(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
|
||||
return fxMenu;
|
||||
}
|
||||
|
||||
|
||||
@@ -847,6 +847,7 @@ SampleTrackView::~SampleTrackView()
|
||||
|
||||
|
||||
|
||||
//FIXME: This is identical to InstrumentTrackView::createFxMenu
|
||||
QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
{
|
||||
int channelIndex = model()->effectChannelModel()->value();
|
||||
@@ -861,8 +862,6 @@ QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
QMenu *fxMenu = new QMenu(title);
|
||||
|
||||
QSignalMapper * fxMenuSignalMapper = new QSignalMapper(fxMenu);
|
||||
|
||||
fxMenu->addAction(newFxLabel, this, SLOT(createFxLine()));
|
||||
fxMenu->addSeparator();
|
||||
|
||||
@@ -872,14 +871,14 @@ QMenu * SampleTrackView::createFxMenu(QString title, QString newFxLabel)
|
||||
|
||||
if (currentChannel != fxChannel)
|
||||
{
|
||||
const auto index = currentChannel->m_channelIndex;
|
||||
QString label = tr("FX %1: %2").arg(currentChannel->m_channelIndex).arg(currentChannel->m_name);
|
||||
QAction * action = fxMenu->addAction(label, fxMenuSignalMapper, SLOT(map()));
|
||||
fxMenuSignalMapper->setMapping(action, currentChannel->m_channelIndex);
|
||||
fxMenu->addAction(label, [this, index](){
|
||||
assignFxLine(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
connect(fxMenuSignalMapper, SIGNAL(mapped(int)), this, SLOT(assignFxLine(int)));
|
||||
|
||||
return fxMenu;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user