author | simon <simon> | 2002-12-04 11:40:01 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-04 11:40:01 (UTC) |
commit | 6a11cf48019e28006172cfb9a61e865816c3657e (patch) (side-by-side diff) | |
tree | 45634eded135f17fcdba8e4cb706e87f47f6d5f0 /noncore/multimedia/opieplayer2/playlistfileview.cpp | |
parent | 84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95 (diff) | |
download | opie-6a11cf48019e28006172cfb9a61e865816c3657e.zip opie-6a11cf48019e28006172cfb9a61e865816c3657e.tar.gz opie-6a11cf48019e28006172cfb9a61e865816c3657e.tar.bz2 |
- move more view population logic into PlayListFileView
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistfileview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index 0ed1061..cb16415 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp @@ -7,5 +7,6 @@ PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QString &itemPixmapName, QWidget *parent, const char *name ) - : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ) + : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ), + m_viewPopulated( false ) { addColumn( tr( "Title" ), 140); @@ -33,15 +34,26 @@ void PlayListFileView::scanFiles() Global::findDocuments( &m_files, m_mimeTypePattern ); + + if ( m_viewPopulated ) { + m_viewPopulated = false; + populateView(); + } } void PlayListFileView::populateView() { + if ( m_viewPopulated ) + return; + clear(); if( !m_scannedFiles ) { + m_viewPopulated = false; // avoid a recursion :) scanFiles(); m_scannedFiles = true; } + m_viewPopulated = true; + QString storage; QListIterator<DocLnk> dit( m_files.children() ); |