Merge pull request #1519 from curlymorphic/i1352

Proposed fix for 1352  Ifreeze when adding instruments or moving mixer tracks
This commit is contained in:
Vesa V
2014-12-29 12:39:48 +02:00
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 );
}