summaryrefslogtreecommitdiff
Side-by-side diff
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 )
// see which skins are installed
videoScan=false;
audioScan=false;
+ audioPopulated=false;
+ videoPopulated=false;
populateSkinsMenu();
initializeStates();
cfg.setGroup("PlayList");
@@ -617,10 +619,10 @@ void PlayListWidget::tabChanged(QWidget *) {
}
break;
case 1:
{
- audioView->clear();
- populateAudioView();
+ // audioView->clear();
+ if(!audioPopulated) populateAudioView();
if( !tbDeletePlaylist->isHidden() ) {
tbDeletePlaylist->hide();
}
@@ -629,10 +631,10 @@ void PlayListWidget::tabChanged(QWidget *) {
}
break;
case 2:
{
- videoView->clear();
- populateVideoView();
+ // videoView->clear();
+ if(!videoPopulated) populateVideoView();
if( !tbDeletePlaylist->isHidden() ) {
tbDeletePlaylist->hide();
}
d->tbRemoveFromList->setEnabled(FALSE);
@@ -685,9 +687,10 @@ void PlayListWidget::scanForAudio() {
delete sdit.current();
}
// Global::findDocuments( &files, "audio/*");
Global::findDocuments( &files, audioMimes);
- audioScan = TRUE;
+ audioScan = true;
+ populateAudioView();
}
void PlayListWidget::scanForVideo() {
// qDebug("scan for video");
@@ -696,9 +699,10 @@ void PlayListWidget::scanForVideo() {
for ( ; sdit.current(); ++sdit ) {
delete sdit.current();
}
Global::findDocuments(&vFiles, "video/*");
- videoScan = TRUE;
+ videoScan = true;
+ populateVideoView();
}
void PlayListWidget::populateAudioView() {
audioView->clear();
@@ -733,8 +737,9 @@ void PlayListWidget::populateAudioView() {
QString::number(size ), storage, dit.current()->file());
newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) );
}
}
+ audioPopulated=true;
}
void PlayListWidget::populateVideoView() {
@@ -767,8 +772,9 @@ void PlayListWidget::populateVideoView() {
storage, Vdit.current()->file());
newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) );
}
}
+ videoPopulated=true;
}
void 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:
void keyReleaseEvent( QKeyEvent *e);
private:
int defaultSkinIndex;
- bool audioScan, videoScan;
+ bool audioScan, videoScan, audioPopulated, videoPopulated;
void readm3u(const QString &);
void readPls(const QString &);
void initializeStates();
void populateAudioView();