Proposed fix for 1352 Instrument crash on loading

This commit is contained in:
Dave French
2014-12-27 17:47:31 +00:00
parent 1cd8c0e2c4
commit d68f8d7302
2 changed files with 36 additions and 1 deletions

View File

@@ -47,6 +47,9 @@
#include "Track.h"
TrackContainerView::TrackContainerView( TrackContainer * _tc ) :
QWidget(),
ModelView( NULL, this ),
@@ -325,7 +328,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de )
InstrumentTrack * it = dynamic_cast<InstrumentTrack *>(
Track::create( Track::InstrumentTrack,
m_tc ) );
it->loadInstrument( value );
InstrumentLoaderThread *ilt = new InstrumentLoaderThread( this, it, value);
ilt->start();
//it->toggledInstrumentTrackButton( true );
_de->accept();
}
@@ -450,6 +454,19 @@ void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we )
}
}
InstrumentLoaderThread::InstrumentLoaderThread( QObject *parent, InstrumentTrack *it, QString name) : QThread( parent )
{
m_it = it;
m_name = name;
}
void InstrumentLoaderThread::run()
{
m_it->loadInstrument( m_name );
}