Commit ec12527a authored by Geoffroy Lacarriere's avatar Geoffroy Lacarriere
Browse files

Udpate library thumbnails when snapshot is taken

parent be57b1f6
......@@ -21,6 +21,8 @@ void MediaListViewController::newMediaLoaded( Media* media )
connect( cell, SIGNAL ( cellSelected( QUuid ) ), this, SLOT ( cellSelection( QUuid ) ) );
connect( cell, SIGNAL ( cellDeleted( QUuid ) ), this, SLOT( mediaDeletion( QUuid ) ) );
if ( media->getMetadata() != Media::ParsedWithSnapshot )
connect( media, SIGNAL( snapshotComputed( Media* ) ), this, SLOT( updateCell( Media* ) ) );
cell->setThumbnail( media->getSnapshot() );
cell->setTitle( media->getFileName() );
cell->setLength( media->getLengthMS() );
......@@ -53,3 +55,10 @@ void MediaListViewController::mediaRemoved( const QUuid& uuid )
m_cells->remove( uuid );
m_currentUuid = QUuid();
}
void MediaListViewController::updateCell( Media* media )
{
MediaCellView* cell = dynamic_cast<MediaCellView*>( m_cells->value( media->getUuid(), NULL ) );
if ( cell != NULL )
cell->setThumbnail( media->getSnapshot() );
}
......@@ -25,6 +25,7 @@ public slots:
void cellSelection( const QUuid& uuid );
void mediaDeletion( const QUuid& uuid );
void mediaRemoved( const QUuid& uuid );
void updateCell( Media* media );
signals:
void mediaSelected( Media* media );
void mediaDeleted( const QUuid& 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