author | simon <simon> | 2002-12-04 11:20:48 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-04 11:20:48 (UTC) |
commit | 84d5ca934e9cb8950d1efdb90ac3b00ce6d44e95 (patch) (side-by-side diff) | |
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) (show 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 @@ #include "playlistfileview.h" +#include <qfile.h> #include <qpe/global.h> +#include <qpe/resource.h> -PlayListFileView::PlayListFileView( const QString &mimeTypePattern, QWidget *parent, const char *name ) - : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_scannedFiles( false ) +PlayListFileView::PlayListFileView( const QString &mimeTypePattern, const QString &itemPixmapName, QWidget *parent, const char *name ) + : PlayListView( parent, name ), m_mimeTypePattern( mimeTypePattern ), m_itemPixmapName( itemPixmapName ), m_scannedFiles( false ) { addColumn( tr( "Title" ), 140); addColumn( tr( "Size" ), -1 ); addColumn(tr( "Media" ), 0 ); addColumn(tr( "Path" ), -1 ); setColumnAlignment( 1, Qt::AlignRight ); @@ -29,8 +31,36 @@ void PlayListFileView::scanFiles() for ( ; sdit.current(); ++sdit ) delete sdit.current(); Global::findDocuments( &m_files, m_mimeTypePattern ); } +void PlayListFileView::populateView() +{ + clear(); + + if( !m_scannedFiles ) { + scanFiles(); + m_scannedFiles = true; + } + + QString storage; + QListIterator<DocLnk> dit( m_files.children() ); + for ( ; dit.current(); ++dit ) { + + QListViewItem *newItem; + + if ( QFile::exists( dit.current()->file() ) || + dit.current()->file().left( 4 ) == "http" ) { + + unsigned long size = QFile( dit.current()->file() ).size(); + + newItem = new QListViewItem( this, dit.current()->name(), + QString::number( size ), "" /*storage*/, + dit.current()->file() ); + newItem->setPixmap( 0, Resource::loadPixmap( m_itemPixmapName ) ); + } + } +} + /* vim: et sw=4 ts=4 */ |