[vlmc-devel] MediaListView: Update the selected item when an item gets removed ( not deleted)
Hugo Beauzée-Luyssen
git at videolan.org
Sun Sep 23 20:46:42 CEST 2012
vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Sun Sep 23 20:17:15 2012 +0300| [c74b3ca26be72eb5d034aa68f39deb48d19e7411] | committer: Hugo Beauzée-Luyssen
MediaListView: Update the selected item when an item gets removed (not deleted)
> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=c74b3ca26be72eb5d034aa68f39deb48d19e7411
---
src/Gui/import/ImportController.cpp | 17 ++++++++++-------
src/Gui/library/MediaListView.cpp | 2 ++
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/src/Gui/import/ImportController.cpp b/src/Gui/import/ImportController.cpp
index 08d26a6..caaf7da 100644
--- a/src/Gui/import/ImportController.cpp
+++ b/src/Gui/import/ImportController.cpp
@@ -132,13 +132,16 @@ ImportController::changeEvent( QEvent *e )
void
ImportController::clipSelection( Clip* clip )
{
- const QUuid& uuid = clip->uuid();
- if ( m_currentUuid == uuid )
- return ;
- m_ui->metadataContainer->setWatchedClip( clip );
- m_clipRenderer->stop();
- m_currentUuid = uuid;
-// m_tag->clipSelected( clip );
+ if ( clip != NULL )
+ {
+ const QUuid& uuid = clip->uuid();
+ if ( m_currentUuid == uuid )
+ return ;
+ m_ui->metadataContainer->setWatchedClip( clip );
+ m_clipRenderer->stop();
+ m_currentUuid = uuid;
+ // m_tag->clipSelected( clip );
+ }
emit clipSelected( clip );
}
diff --git a/src/Gui/library/MediaListView.cpp b/src/Gui/library/MediaListView.cpp
index 6d0714b..8ce3cda 100644
--- a/src/Gui/library/MediaListView.cpp
+++ b/src/Gui/library/MediaListView.cpp
@@ -101,6 +101,8 @@ MediaListView::__clipRemoved( const QUuid &uuid )
MediaCellView* cell = m_cells.take( uuid );
removeCell( cell );
m_currentUuid = QUuid();
+ // cancel out selection state (mostly to inform the renderer)
+ emit clipSelected( NULL );
}
void
More information about the Vlmc-devel
mailing list