Commit 002f8153 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Solved crash when undo/redoing clip move

parent bd4e528a
......@@ -142,6 +142,7 @@ void Timeline::actionAddClip( Clip* clip, unsigned int track, qint64 start, Main
void Timeline::actionMoveClip( const QUuid& uuid, unsigned int track, qint64 time, MainWorkflow::TrackType )
{
tracksView()->moveMediaItem( uuid, track, time );
Q_ASSERT( tracksView()->setItemOldTrack( uuid, track ) == true );
tracksView()->updateDuration();
tracksRuler()->update();
}
......
......@@ -209,6 +209,21 @@ void TracksView::dragMoveEvent( QDragMoveEvent* event )
moveMediaItem( m_dragItem, event->pos() );
}
bool TracksView::setItemOldTrack( const QUuid &uuid, uint32_t oldTrackNumber )
{
QList<QGraphicsItem*> sceneItems = m_scene->items();
for ( int i = 0; i < sceneItems.size(); ++i )
{
AbstractGraphicsMediaItem* item =
dynamic_cast<AbstractGraphicsMediaItem*>( sceneItems.at( i ) );
if ( !item || item->uuid() != uuid ) continue;
item->oldTrackNumber = oldTrackNumber;
return true;
}
return false;
}
void TracksView::moveMediaItem( const QUuid& uuid, unsigned int track, qint64 time )
{
QList<QGraphicsItem*> sceneItems = m_scene->items();
......
......@@ -62,6 +62,14 @@ public:
void setTool( ToolButtons button );
ToolButtons tool() { return m_tool; }
WorkflowRenderer* getRenderer() { return m_renderer; }
//MEGAFIXME
//FIXME
//REMOVEME
//TODO
//YOU'RE HIDING A BUG
//WRONG
//Ugly method provided by etix :)
bool setItemOldTrack( const QUuid& uuid, uint32_t oldTrackNumber );
public slots:
void clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment