author | llornkcor <llornkcor> | 2002-11-14 02:56:04 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-14 02:56:04 (UTC) |
commit | 4a60497bd689bd01ca301378f382bff6863b592e (patch) (side-by-side diff) | |
tree | 3b9926eb8f6f89b204eaca2a443b6bb9b5e9f883 /noncore/multimedia/opieplayer2 | |
parent | 3bfb64a41ca7948b593982fc1c266d5ec829b9ab (diff) | |
download | opie-4a60497bd689bd01ca301378f382bff6863b592e.zip opie-4a60497bd689bd01ca301378f382bff6863b592e.tar.gz opie-4a60497bd689bd01ca301378f382bff6863b592e.tar.bz2 |
no longer scans and populates audio_video lists everytime tab is changed. rescan from File menu does it except for the first tab change
Diffstat (limited to 'noncore/multimedia/opieplayer2') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 18 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.h | 2 |
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 @@ -153,12 +153,14 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) connect ( gammaSlider, SIGNAL( valueChanged( int ) ), mediaPlayerState, SLOT( setVideoGamma( int ) ) ); // see which skins are installed videoScan=false; audioScan=false; + audioPopulated=false; + videoPopulated=false; populateSkinsMenu(); initializeStates(); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry( "CurrentPlaylist", "default"); loadList(DocLnk( currentPlaylist ) ); @@ -615,26 +617,26 @@ void PlayListWidget::tabChanged(QWidget *) { d->tbRemoveFromList->setEnabled(TRUE); d->tbAddToList->setEnabled(FALSE); } break; case 1: { - audioView->clear(); - populateAudioView(); + // audioView->clear(); + if(!audioPopulated) populateAudioView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } break; case 2: { - videoView->clear(); - populateVideoView(); + // videoView->clear(); + if(!videoPopulated) populateVideoView(); if( !tbDeletePlaylist->isHidden() ) { tbDeletePlaylist->hide(); } d->tbRemoveFromList->setEnabled(FALSE); d->tbAddToList->setEnabled(TRUE); } @@ -683,24 +685,26 @@ void PlayListWidget::scanForAudio() { QListIterator<DocLnk> sdit( files.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } // Global::findDocuments( &files, "audio/*"); Global::findDocuments( &files, audioMimes); - audioScan = TRUE; + audioScan = true; + populateAudioView(); } void PlayListWidget::scanForVideo() { // qDebug("scan for video"); vFiles.detachChildren(); QListIterator<DocLnk> sdit( vFiles.children() ); for ( ; sdit.current(); ++sdit ) { delete sdit.current(); } Global::findDocuments(&vFiles, "video/*"); - videoScan = TRUE; + videoScan = true; + populateVideoView(); } void PlayListWidget::populateAudioView() { audioView->clear(); StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); @@ -731,12 +735,13 @@ void PlayListWidget::populateAudioView() { size = QFile( dit.current()->file() ).size(); newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number(size ), storage, dit.current()->file()); newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) ); } } + audioPopulated=true; } void PlayListWidget::populateVideoView() { videoView->clear(); StorageInfo storageInfo; @@ -765,12 +770,13 @@ void PlayListWidget::populateVideoView() { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file() ).size() ), storage, Vdit.current()->file()); newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); } } + videoPopulated=true; } void PlayListWidget::openFile() { // http://66.28.164.33:2080 // http://somafm.com/star0242.m3u 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 @@ -77,13 +77,13 @@ public slots: QString currentFileListPathName(); 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(); void populateVideoView(); |