Commit aff0ecd0 authored by Clement CHAVANCE's avatar Clement CHAVANCE
Browse files

Clips added to clip list of the media library

This part only works when the clips have been created in the import
window
parent 4a4005ac
......@@ -71,13 +71,11 @@ void ClipListViewController::clean()
void ClipListViewController::cellSelection( const QUuid& uuid )
{
qDebug() << "cell selected";
if ( m_currentUuid == uuid )
return;
if ( m_cells.contains( uuid ) )
{
qDebug() << "uuid found" << uuid;
if ( !m_currentUuid.isNull() && m_cells.contains( m_currentUuid ) )
m_cells.value( m_currentUuid )->setPalette( m_cells.value( uuid )->palette() );
QPalette p = m_cells.value( uuid )->palette();
......
......@@ -48,7 +48,10 @@ Media* Library::getMedia( const QUuid& uuid )
Clip* Library::getClip( const QUuid& uuid )
{
return getElementByUuid( m_clips, uuid );
Clip* clip;
clip = getElementByUuid( m_clips, uuid );
return clip;
}
void Library::removingMediaAsked( const QUuid& uuid )
......@@ -92,6 +95,16 @@ void Library::metaDataComputed( Media* media )
emit newMediaLoaded( media );
Clip* clip = new Clip( media );
m_clips[media->getUuid()] = clip;
//If the media have some clip, add then to m_clips
const QHash<QUuid, Clip*>* clips = media->clips();
if ( clips->size() != 0 )
{
QHash<QUuid, Clip*>::const_iterator it = clips->begin();
QHash<QUuid, Clip*>::const_iterator ed = clips->end();
for ( ; it != ed; ++it )
m_clips[it.key()] = it.value();
}
}
void Library::newMediaLoadingAsked( const QString& filePath, const QString& uuid )
......
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