Commit 8892561b authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Media: Base clip can't be const.

Ho and please, don't clone an objet to get over its constness.
parent 9f6df32d
......@@ -133,15 +133,14 @@ void MediaCellView::mouseMoveEvent( QMouseEvent* event )
QDrag* drag = new QDrag( this );
drag->setMimeData( mimeData );
//FIXME : change the way the library handles Clips
Clip* clip = Library::getInstance()->clip( m_uuid );
const Clip* clip = Library::getInstance()->clip( m_uuid );
if ( 0 == clip )
return ;
//getting the media from the current Clip
Media* parent = Library::getInstance()->clip( m_uuid )->getParent();
const Media* parent = Library::getInstance()->clip( m_uuid )->getParent();
if ( 0 == parent )
return ;
drag->setPixmap( Library::getInstance()->clip( m_uuid )->getParent()->
snapshot().scaled( 100, 100, Qt::KeepAspectRatio ) );
drag->setPixmap( parent->snapshot().scaled( 100, 100, Qt::KeepAspectRatio ) );
drag->exec( Qt::CopyAction | Qt::MoveAction, Qt::CopyAction );
}
......
......@@ -61,8 +61,7 @@ Library::clip( const QUuid& uuid )
Media* media = m_medias.value( uuid );
if ( media->baseClip() == NULL )
return NULL;
Clip* clip = new Clip( media->baseClip() );
return clip;
return media->baseClip();
}
QUuid mediaUuid;
......@@ -83,7 +82,7 @@ Library::clip( const QUuid& mediaUuid, const QUuid& clipUuid )
if ( m_medias.value( mediaUuid )->clips().contains( clipUuid ) )
return m_medias.value( mediaUuid )->clip( clipUuid );
else
return new Clip( m_medias.value( mediaUuid )->baseClip() );
m_medias.value( mediaUuid )->baseClip();
}
return NULL;
}
......
......@@ -69,7 +69,6 @@ class Clip : public QObject
/**
\return Returns the Media that the clip was basep uppon.
*/
Media* getParent();
......
......@@ -148,7 +148,7 @@ public:
QList<int>* audioValues() { return m_audioValueList; }
const Clip* baseClip() const { return m_baseClip; }
Clip* baseClip() { return m_baseClip; }
private:
void setFileType();
......
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