author | simon <simon> | 2002-12-04 11:03:26 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-04 11:03:26 (UTC) |
commit | 9b30090fddf1cc2e8ffbff70b164213118106167 (patch) (side-by-side diff) | |
tree | a328c893928233cd0f17f1842d150ecf87530efe | |
parent | 63541c46776721ef5ae63903e5b40838c1c49a43 (diff) | |
download | opie-9b30090fddf1cc2e8ffbff70b164213118106167.zip opie-9b30090fddf1cc2e8ffbff70b164213118106167.tar.gz opie-9b30090fddf1cc2e8ffbff70b164213118106167.tar.bz2 |
- moving videoScan and audioScan into PlayListFileView
4 files changed, 14 insertions, 12 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index 2726296..1e2ef89 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp @@ -1,15 +1,15 @@ #include "playlistfileview.h" #include <qpe/global.h> PlayListFileView::PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name ) - : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ) + : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_scannedFiles( false ) { addColumn( tr( "Title" ), 140); addColumn( tr( "Size" ), -1 ); addColumn(tr( "Media" ), 0 ); addColumn(tr( "Path" ), -1 ); setColumnAlignment( 1, Qt::AlignRight ); setColumnAlignment( 2, Qt::AlignRight ); setAllColumnsShowFocus( TRUE ); diff --git a/noncore/multimedia/opieplayer2/playlistfileview.h b/noncore/multimedia/opieplayer2/playlistfileview.h index 08db929..4e17966 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.h +++ b/noncore/multimedia/opieplayer2/playlistfileview.h @@ -7,21 +7,25 @@ class PlayListFileView : public PlayListView { Q_OBJECT public: PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name = 0 ); virtual ~PlayListFileView(); + // both temporarily accessible that way until the caller code has + // been migrated into this class DocLnkSet &files() { return m_files; } + bool &scannedFiles() { return m_scannedFiles; } public slots: void scanFiles(); private: QString m_mimeTypePattern; DocLnkSet m_files; + bool m_scannedFiles; }; #endif // PLAYLISTFILEVIEW_H /* vim: et sw=4 ts=4 */ diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 93e7919..12b8a71 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -146,18 +146,16 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par connect( &mediaPlayerState, SIGNAL( shuffledToggled( bool ) ), d->tbShuffle, SLOT( setOn( bool ) ) ); connect( d->selectedFiles, SIGNAL( doubleClicked( QListViewItem *) ), this, SLOT( playIt( QListViewItem *) ) ); 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 ) ); @@ -249,33 +247,33 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi } void PlayListWidget::addAllToList() { // QTime t; // t.start(); - if(!audioScan) { + if(!audioView->scannedFiles()) { if(audioView->childCount() < 1) populateAudioView(); } QListViewItemIterator audioIt( audioView ); DocLnk lnk; QString filename; // iterate through all items of the listview for ( ; audioIt.current(); ++audioIt ) { filename = audioIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); } - if(!videoScan) { + if(!videoView->scannedFiles()) { if(videoView->childCount() < 1) populateVideoView(); } QListViewItemIterator videoIt( videoView ); for ( ; videoIt.current(); ++videoIt ) { filename = videoIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name @@ -309,17 +307,17 @@ void PlayListWidget::addAllToList() { writeCurrentM3u(); d->selectedFiles->first(); } void PlayListWidget::addAllMusicToList() { - if(!audioScan) { + if(!audioView->scannedFiles()) { if(audioView->childCount() < 1) populateAudioView(); } QListViewItemIterator audioIt( audioView ); DocLnk lnk; QString filename; // iterate through all items of the listview @@ -342,17 +340,17 @@ void PlayListWidget::addAllMusicToList() { tabWidget->setCurrentPage(0); writeCurrentM3u(); d->selectedFiles->first(); } void PlayListWidget::addAllVideoToList() { - if(!videoScan) { + if(!videoView->scannedFiles()) { if(videoView->childCount() < 1) populateVideoView(); } QListViewItemIterator videoIt( videoView ); DocLnk lnk; QString filename; for ( ; videoIt.current(); ++videoIt ) { @@ -633,31 +631,31 @@ void PlayListWidget::deletePlaylist() { void PlayListWidget::playSelected() { btnPlay( TRUE); } void PlayListWidget::scanForAudio() { audioView->scanFiles(); - audioScan = true; + audioView->scannedFiles() = true; populateAudioView(); } void PlayListWidget::scanForVideo() { videoView->scanFiles(); - videoScan = true; + videoView->scannedFiles() = true; populateVideoView(); } void PlayListWidget::populateAudioView() { audioView->clear(); StorageInfo storageInfo; // const QList<FileSystem> &fs = storageInfo.fileSystems(); - if(!audioScan) { + if(!audioView->scannedFiles()) { scanForAudio(); } QListIterator<DocLnk> dit( audioView->files().children() ); // QListIterator<FileSystem> it ( fs ); audioView->clear(); QString storage; @@ -690,17 +688,17 @@ void PlayListWidget::populateAudioView() { } void PlayListWidget::populateVideoView() { videoView->clear(); StorageInfo storageInfo; // const QList<FileSystem> &fs = storageInfo.fileSystems(); - if(!videoScan ) { + if(!videoView->scannedFiles()) { scanForVideo(); } QListIterator<DocLnk> Vdit( videoView->files().children() ); // QListIterator<FileSystem> it ( fs ); videoView->clear(); QString storage, pathName; for ( ; Vdit.current(); ++Vdit ) { diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index e81ef3c..58efd47 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h @@ -89,17 +89,17 @@ public slots: protected: void keyReleaseEvent( QKeyEvent *e); signals: void skinSelected(); private: int defaultSkinIndex; - bool audioScan, videoScan, audioPopulated, videoPopulated; + bool audioPopulated, videoPopulated; void readm3u(const QString &); void readPls(const QString &); void initializeStates(); void populateAudioView(); void populateVideoView(); QListView *currentFileListView() const; |