summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp18
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
2 files changed, 13 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index c2b5c77..6bedb57 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -155,8 +155,10 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl )
155 155
156 // see which skins are installed 156 // see which skins are installed
157 videoScan=false; 157 videoScan=false;
158 audioScan=false; 158 audioScan=false;
159 audioPopulated=false;
160 videoPopulated=false;
159 populateSkinsMenu(); 161 populateSkinsMenu();
160 initializeStates(); 162 initializeStates();
161 163
162 cfg.setGroup("PlayList"); 164 cfg.setGroup("PlayList");
@@ -617,10 +619,10 @@ void PlayListWidget::tabChanged(QWidget *) {
617 } 619 }
618 break; 620 break;
619 case 1: 621 case 1:
620 { 622 {
621 audioView->clear(); 623 // audioView->clear();
622 populateAudioView(); 624 if(!audioPopulated) populateAudioView();
623 625
624 if( !tbDeletePlaylist->isHidden() ) { 626 if( !tbDeletePlaylist->isHidden() ) {
625 tbDeletePlaylist->hide(); 627 tbDeletePlaylist->hide();
626 } 628 }
@@ -629,10 +631,10 @@ void PlayListWidget::tabChanged(QWidget *) {
629 } 631 }
630 break; 632 break;
631 case 2: 633 case 2:
632 { 634 {
633 videoView->clear(); 635 // videoView->clear();
634 populateVideoView(); 636 if(!videoPopulated) populateVideoView();
635 if( !tbDeletePlaylist->isHidden() ) { 637 if( !tbDeletePlaylist->isHidden() ) {
636 tbDeletePlaylist->hide(); 638 tbDeletePlaylist->hide();
637 } 639 }
638 d->tbRemoveFromList->setEnabled(FALSE); 640 d->tbRemoveFromList->setEnabled(FALSE);
@@ -685,9 +687,10 @@ void PlayListWidget::scanForAudio() {
685 delete sdit.current(); 687 delete sdit.current();
686 } 688 }
687// Global::findDocuments( &files, "audio/*"); 689// Global::findDocuments( &files, "audio/*");
688 Global::findDocuments( &files, audioMimes); 690 Global::findDocuments( &files, audioMimes);
689 audioScan = TRUE; 691 audioScan = true;
692 populateAudioView();
690} 693}
691 694
692void PlayListWidget::scanForVideo() { 695void PlayListWidget::scanForVideo() {
693// qDebug("scan for video"); 696// qDebug("scan for video");
@@ -696,9 +699,10 @@ void PlayListWidget::scanForVideo() {
696 for ( ; sdit.current(); ++sdit ) { 699 for ( ; sdit.current(); ++sdit ) {
697 delete sdit.current(); 700 delete sdit.current();
698 } 701 }
699 Global::findDocuments(&vFiles, "video/*"); 702 Global::findDocuments(&vFiles, "video/*");
700 videoScan = TRUE; 703 videoScan = true;
704 populateVideoView();
701} 705}
702 706
703void PlayListWidget::populateAudioView() { 707void PlayListWidget::populateAudioView() {
704 audioView->clear(); 708 audioView->clear();
@@ -733,8 +737,9 @@ void PlayListWidget::populateAudioView() {
733 QString::number(size ), storage, dit.current()->file()); 737 QString::number(size ), storage, dit.current()->file());
734 newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); 738 newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) );
735 } 739 }
736 } 740 }
741 audioPopulated=true;
737} 742}
738 743
739 744
740void PlayListWidget::populateVideoView() { 745void PlayListWidget::populateVideoView() {
@@ -767,8 +772,9 @@ void PlayListWidget::populateVideoView() {
767 storage, Vdit.current()->file()); 772 storage, Vdit.current()->file());
768 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); 773 newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) );
769 } 774 }
770 } 775 }
776 videoPopulated=true;
771} 777}
772 778
773 779
774void PlayListWidget::openFile() { 780void PlayListWidget::openFile() {
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 53be7a7..b2c389e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -79,9 +79,9 @@ protected:
79 void keyReleaseEvent( QKeyEvent *e); 79 void keyReleaseEvent( QKeyEvent *e);
80 80
81private: 81private:
82 int defaultSkinIndex; 82 int defaultSkinIndex;
83 bool audioScan, videoScan; 83 bool audioScan, videoScan, audioPopulated, videoPopulated;
84 void readm3u(const QString &); 84 void readm3u(const QString &);
85 void readPls(const QString &); 85 void readPls(const QString &);
86 void initializeStates(); 86 void initializeStates();
87 void populateAudioView(); 87 void populateAudioView();