6 files changed, 37 insertions, 28 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index c4f93e7..2726296 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp | |||
@@ -3,4 +3,6 @@ | |||
3 | 3 | ||
4 | PlayListFileView::PlayListFileView( QWidget *parent, const char *name ) | 4 | #include <qpe/global.h> |
5 | : PlayListView( parent, name ) | 5 | |
6 | PlayListFileView::PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name ) | ||
7 | : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ) | ||
6 | { | 8 | { |
@@ -22,2 +24,12 @@ PlayListFileView::~PlayListFileView() | |||
22 | 24 | ||
25 | void PlayListFileView::scanFiles() | ||
26 | { | ||
27 | m_files.detachChildren(); | ||
28 | QListIterator<DocLnk> sdit( m_files.children() ); | ||
29 | for ( ; sdit.current(); ++sdit ) | ||
30 | delete sdit.current(); | ||
31 | |||
32 | Global::findDocuments( &m_files, m_mimeTypePattern ); | ||
33 | } | ||
34 | |||
23 | /* vim: et sw=4 ts=4 | 35 | /* vim: et sw=4 ts=4 |
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.h b/noncore/multimedia/opieplayer2/playlistfileview.h index eef4bd1..08db929 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.h +++ b/noncore/multimedia/opieplayer2/playlistfileview.h | |||
@@ -5,2 +5,4 @@ | |||
5 | 5 | ||
6 | #include <qpe/applnk.h> | ||
7 | |||
6 | class PlayListFileView : public PlayListView | 8 | class PlayListFileView : public PlayListView |
@@ -9,4 +11,13 @@ class PlayListFileView : public PlayListView | |||
9 | public: | 11 | public: |
10 | PlayListFileView( QWidget *parent, const char *name = 0 ); | 12 | PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name = 0 ); |
11 | virtual ~PlayListFileView(); | 13 | virtual ~PlayListFileView(); |
14 | |||
15 | DocLnkSet &files() { return m_files; } | ||
16 | |||
17 | public slots: | ||
18 | void scanFiles(); | ||
19 | |||
20 | private: | ||
21 | QString m_mimeTypePattern; | ||
22 | DocLnkSet m_files; | ||
12 | }; | 23 | }; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 6bda71e..93e7919 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -51,2 +51,3 @@ | |||
51 | #include "om3u.h" | 51 | #include "om3u.h" |
52 | #include "playlistfileview.h" | ||
52 | 53 | ||
@@ -63,5 +64,2 @@ extern MediaPlayerState *mediaPlayerState; | |||
63 | 64 | ||
64 | QString audioMimes ="audio/mpeg;audio/x-wav;audio/x-ogg"; | ||
65 | // no m3u's here please | ||
66 | |||
67 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) | 65 | PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) |
@@ -641,10 +639,3 @@ void PlayListWidget::playSelected() { | |||
641 | void PlayListWidget::scanForAudio() { | 639 | void PlayListWidget::scanForAudio() { |
642 | // qDebug("scan for audio"); | 640 | audioView->scanFiles(); |
643 | files.detachChildren(); | ||
644 | QListIterator<DocLnk> sdit( files.children() ); | ||
645 | for ( ; sdit.current(); ++sdit ) { | ||
646 | delete sdit.current(); | ||
647 | } | ||
648 | // Global::findDocuments( &files, "audio/*"); | ||
649 | Global::findDocuments( &files, audioMimes); | ||
650 | audioScan = true; | 641 | audioScan = true; |
@@ -654,9 +645,3 @@ void PlayListWidget::scanForAudio() { | |||
654 | void PlayListWidget::scanForVideo() { | 645 | void PlayListWidget::scanForVideo() { |
655 | // qDebug("scan for video"); | 646 | videoView->scanFiles(); |
656 | vFiles.detachChildren(); | ||
657 | QListIterator<DocLnk> sdit( vFiles.children() ); | ||
658 | for ( ; sdit.current(); ++sdit ) { | ||
659 | delete sdit.current(); | ||
660 | } | ||
661 | Global::findDocuments(&vFiles, "video/*"); | ||
662 | videoScan = true; | 647 | videoScan = true; |
@@ -673,3 +658,3 @@ void PlayListWidget::populateAudioView() { | |||
673 | 658 | ||
674 | QListIterator<DocLnk> dit( files.children() ); | 659 | QListIterator<DocLnk> dit( audioView->files().children() ); |
675 | // QListIterator<FileSystem> it ( fs ); | 660 | // QListIterator<FileSystem> it ( fs ); |
@@ -716,3 +701,3 @@ void PlayListWidget::populateVideoView() { | |||
716 | 701 | ||
717 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 702 | QListIterator<DocLnk> Vdit( videoView->files().children() ); |
718 | // QListIterator<FileSystem> it ( fs ); | 703 | // QListIterator<FileSystem> it ( fs ); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h index 62d78a2..e81ef3c 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.h +++ b/noncore/multimedia/opieplayer2/playlistwidget.h | |||
@@ -136,4 +136,2 @@ private slots: | |||
136 | private: | 136 | private: |
137 | DocLnkSet files; | ||
138 | DocLnkSet vFiles; | ||
139 | bool fromSetDocument; | 137 | bool fromSetDocument; |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp index cfca5e3..a219cfd 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.cpp | |||
@@ -152,3 +152,4 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg | |||
152 | Alayout->setMargin( 2 ); | 152 | Alayout->setMargin( 2 ); |
153 | audioView = new PlayListFileView( aTab, "Audioview" ); | 153 | // no m3u's here please |
154 | audioView = new PlayListFileView( "audio/mpeg;audio/x-wav;audio/x-ogg", aTab, "Audioview" ); | ||
154 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); | 155 | Alayout->addMultiCellWidget( audioView, 0, 0, 0, 1 ); |
@@ -164,3 +165,3 @@ PlayListWidgetGui::PlayListWidgetGui( MediaPlayerState &_mediaPlayerState, QWidg | |||
164 | Vlayout->setMargin( 2 ); | 165 | Vlayout->setMargin( 2 ); |
165 | videoView = new PlayListFileView( vTab, "Videoview" ); | 166 | videoView = new PlayListFileView( "video/*", vTab, "Videoview" ); |
166 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); | 167 | Vlayout->addMultiCellWidget( videoView, 0, 0, 0, 1 ); |
diff --git a/noncore/multimedia/opieplayer2/playlistwidgetgui.h b/noncore/multimedia/opieplayer2/playlistwidgetgui.h index 9b5252a..0d8af43 100644 --- a/noncore/multimedia/opieplayer2/playlistwidgetgui.h +++ b/noncore/multimedia/opieplayer2/playlistwidgetgui.h | |||
@@ -52,2 +52,3 @@ class PlayListSelection; | |||
52 | class MediaPlayerState; | 52 | class MediaPlayerState; |
53 | class PlayListFileView; | ||
53 | 54 | ||
@@ -103,3 +104,4 @@ protected: | |||
103 | QTabWidget * tabWidget; | 104 | QTabWidget * tabWidget; |
104 | QListView *audioView, *videoView, *playlistView; | 105 | PlayListFileView *audioView, *videoView; |
106 | QListView *playlistView; | ||
105 | QLabel *libString; | 107 | QLabel *libString; |