author | simon <simon> | 2002-12-04 11:20:48 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-04 11:20:48 (UTC) |
commit | 84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95 (patch) (unidiff) | |
tree | bb84499e28cfb1d518e3cebf504eb9279257ced9 /noncore/multimedia/opieplayer2/playlistfileview.cpp | |
parent | 9b30090fddf1cc2e8ffbff70b164213118106167 (diff) | |
download | opie-84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95.zip opie-84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95.tar.gz opie-84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95.tar.bz2 |
- merged popuplateAudioView and popuplateVideoView into one
PlayListFileView::popuplateView method
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistfileview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistfileview.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistfileview.cpp b/noncore/multimedia/opieplayer2/playlistfileview.cpp index 1e2ef89..0ed1061 100644 --- a/noncore/multimedia/opieplayer2/playlistfileview.cpp +++ b/noncore/multimedia/opieplayer2/playlistfileview.cpp | |||
@@ -1,13 +1,15 @@ | |||
1 | 1 | ||
2 | #include "playlistfileview.h" | 2 | #include "playlistfileview.h" |
3 | 3 | ||
4 | #include <qfile.h> | ||
4 | #include <qpe/global.h> | 5 | #include <qpe/global.h> |
6 | #include <qpe/resource.h> | ||
5 | 7 | ||
6 | PlayListFileView::PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name ) | 8 | PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QString &itemPixmapName, QWidget *parent, const char *name ) |
7 | : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_scannedFiles( false ) | 9 | : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ) |
8 | { | 10 | { |
9 | addColumn( tr( "Title" ), 140); | 11 | addColumn( tr( "Title" ), 140); |
10 | addColumn( tr( "Size" ), -1 ); | 12 | addColumn( tr( "Size" ), -1 ); |
11 | addColumn(tr( "Media" ), 0 ); | 13 | addColumn(tr( "Media" ), 0 ); |
12 | addColumn(tr( "Path" ), -1 ); | 14 | addColumn(tr( "Path" ), -1 ); |
13 | setColumnAlignment( 1, Qt::AlignRight ); | 15 | setColumnAlignment( 1, Qt::AlignRight ); |
@@ -29,8 +31,36 @@ void PlayListFileView::scanFiles() | |||
29 | for ( ; sdit.current(); ++sdit ) | 31 | for ( ; sdit.current(); ++sdit ) |
30 | delete sdit.current(); | 32 | delete sdit.current(); |
31 | 33 | ||
32 | Global::findDocuments( &m_files, m_mimeTypePattern ); | 34 | Global::findDocuments( &m_files, m_mimeTypePattern ); |
33 | } | 35 | } |
34 | 36 | ||
37 | void PlayListFileView::populateView() | ||
38 | { | ||
39 | clear(); | ||
40 | |||
41 | if( !m_scannedFiles ) { | ||
42 | scanFiles(); | ||
43 | m_scannedFiles = true; | ||
44 | } | ||
45 | |||
46 | QString storage; | ||
47 | QListIterator<DocLnk> dit( m_files.children() ); | ||
48 | for ( ; dit.current(); ++dit ) { | ||
49 | |||
50 | QListViewItem *newItem; | ||
51 | |||
52 | if ( QFile::exists( dit.current()->file() ) || | ||
53 | dit.current()->file().left( 4 ) == "http" ) { | ||
54 | |||
55 | unsigned long size = QFile( dit.current()->file() ).size(); | ||
56 | |||
57 | newItem = new QListViewItem( this, dit.current()->name(), | ||
58 | QString::number( size ), "" /*storage*/, | ||
59 | dit.current()->file() ); | ||
60 | newItem->setPixmap( 0, Resource::loadPixmap( m_itemPixmapName ) ); | ||
61 | } | ||
62 | } | ||
63 | } | ||
64 | |||
35 | /* vim: et sw=4 ts=4 | 65 | /* vim: et sw=4 ts=4 |
36 | */ | 66 | */ |