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 | |
parent | 84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95 (diff) | |
download | opie-6a11cf48019e28006172cfb9a61e865816c3657e.zip opie-6a11cf48019e28006172cfb9a61e865816c3657e.tar.gz opie-6a11cf48019e28006172cfb9a61e865816c3657e.tar.bz2 |
- move more view population logic into PlayListFileView
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 14 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.h | 1 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 30 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 3 |
4 files changed, 20 insertions, 28 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 @@ -8,3 +8,4 @@ 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 ) { @@ -34,2 +35,7 @@ void PlayListFileView::scanFiles() Global::findDocuments( &m_files, m_mimeTypePattern ); + + if ( m_viewPopulated ) { + m_viewPopulated = false; + populateView(); + } } @@ -38,2 +44,5 @@ void PlayListFileView::populateView() { + if ( m_viewPopulated ) + return; + clear(); @@ -41,2 +50,3 @@ void PlayListFileView::populateView() if( !m_scannedFiles ) { + m_viewPopulated = false; // avoid a recursion :) scanFiles(); @@ -45,2 +55,4 @@ void PlayListFileView::populateView() + m_viewPopulated = true; + QString storage; diff --git a/noncore/multimedia/opieplayer2/playlistfileview.h b/noncore/multimedia/opieplayer2/playlistfileview.h index a00349e..448473e 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.h +++ b/noncore/multimedia/opieplayer2/playlistfileview.h @@ -28,2 +28,3 @@ private: bool m_scannedFiles; + bool m_viewPopulated; }; diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 460a0bf..eb0606d 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -153,4 +153,2 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par // see which skins are installed - audioPopulated=false; - videoPopulated=false; populateSkinsMenu(); @@ -256,3 +254,3 @@ void PlayListWidget::addAllToList() { if(audioView->childCount() < 1) - populateAudioView(); + audioView->populateView(); } @@ -272,3 +270,3 @@ void PlayListWidget::addAllToList() { if(videoView->childCount() < 1) - populateVideoView(); + videoView->populateView(); } @@ -316,3 +314,3 @@ void PlayListWidget::addAllMusicToList() { if(audioView->childCount() < 1) - populateAudioView(); + audioView->populateView(); } @@ -349,3 +347,3 @@ void PlayListWidget::addAllVideoToList() { if(videoView->childCount() < 1) - populateVideoView(); + videoView->populateView(); } @@ -574,4 +572,3 @@ void PlayListWidget::tabChanged(QWidget *) { { - // audioView->clear(); - if(!audioPopulated) populateAudioView(); + audioView->populateView(); @@ -586,4 +583,3 @@ void PlayListWidget::tabChanged(QWidget *) { { - // videoView->clear(); - if(!videoPopulated) populateVideoView(); + videoView->populateView(); if( !tbDeletePlaylist->isHidden() ) { @@ -638,4 +634,2 @@ void PlayListWidget::scanForAudio() { audioView->scanFiles(); - audioView->scannedFiles() = true; - populateAudioView(); } @@ -644,14 +638,2 @@ void PlayListWidget::scanForVideo() { videoView->scanFiles(); - videoView->scannedFiles() = true; - populateVideoView(); -} - -void PlayListWidget::populateAudioView() { - audioView->populateView(); - audioPopulated = true; -} - -void PlayListWidget::populateVideoView() { - videoView->populateView(); - videoPopulated=true; } diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 58efd47..8c22f17 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -96,3 +96,2 @@ private: int defaultSkinIndex; - bool audioPopulated, videoPopulated; void readm3u(const QString &); @@ -100,4 +99,2 @@ private: void initializeStates(); - void populateAudioView(); - void populateVideoView(); |