summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistfileview.cpp2
-rw-r--r--noncore/multimedia/opieplayer2/playlistfileview.h4
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp18
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h2
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,13 +1,13 @@
#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 );
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
@@ -9,19 +9,23 @@ 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
@@ -148,14 +148,12 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par
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");
@@ -251,13 +249,13 @@ 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;
@@ -267,13 +265,13 @@ void PlayListWidget::addAllToList() {
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 ) {
@@ -311,13 +309,13 @@ void PlayListWidget::addAllToList() {
d->selectedFiles->first();
}
void PlayListWidget::addAllMusicToList() {
- if(!audioScan) {
+ if(!audioView->scannedFiles()) {
if(audioView->childCount() < 1)
populateAudioView();
}
QListViewItemIterator audioIt( audioView );
DocLnk lnk;
@@ -344,13 +342,13 @@ void PlayListWidget::addAllMusicToList() {
d->selectedFiles->first();
}
void PlayListWidget::addAllVideoToList() {
- if(!videoScan) {
+ if(!videoView->scannedFiles()) {
if(videoView->childCount() < 1)
populateVideoView();
}
QListViewItemIterator videoIt( videoView );
DocLnk lnk;
@@ -635,27 +633,27 @@ 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();
@@ -692,13 +690,13 @@ 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();
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
@@ -91,13 +91,13 @@ protected:
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();