summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp48
1 files changed, 26 insertions, 22 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 6bedb57..16467c0 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -692,105 +692,109 @@ void PlayListWidget::scanForAudio() {
populateAudioView();
}
void PlayListWidget::scanForVideo() {
// qDebug("scan for video");
vFiles.detachChildren();
QListIterator<DocLnk> sdit( vFiles.children() );
for ( ; sdit.current(); ++sdit ) {
delete sdit.current();
}
Global::findDocuments(&vFiles, "video/*");
videoScan = true;
populateVideoView();
}
void PlayListWidget::populateAudioView() {
audioView->clear();
StorageInfo storageInfo;
const QList<FileSystem> &fs = storageInfo.fileSystems();
if(!audioScan) {
scanForAudio();
}
QListIterator<DocLnk> dit( files.children() );
- QListIterator<FileSystem> it ( fs );
+ // QListIterator<FileSystem> it ( fs );
+ audioView->clear();
QString storage;
- for ( ; dit.current(); ++dit ) {
- for( ; it.current(); ++it ){
- const QString name = (*it)->name();
- const QString path = (*it)->path();
- if(dit.current()->file().find(path) != -1 ) {
- storage = name;
- }
- }
+ for ( ; dit.current(); ++dit ) {
+// // for( ; it.current(); ++it ){
+// const QString name = (*dit)->name();
+// const QString path = (*dit)->path();
+// if(dit.current()->file().find(path) != -1 ) {
+// storage = name;
+// // }
+// }
QListViewItem * newItem;
if ( QFile( dit.current()->file()).exists() ||
dit.current()->file().left(4) == "http" ) {
long size;
if( dit.current()->file().left(4) == "http" )
size=0;
else
size = QFile( dit.current()->file() ).size();
+
newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(),
- QString::number(size ), storage, dit.current()->file());
+ QString::number(size ), "" /*storage*/,
+ dit.current()->file() );
newItem->setPixmap( 0, Resource::loadPixmap( "opieplayer2/musicfile" ) );
- }
+// qDebug("<<<< "+dit.current()->file());
+ }
}
audioPopulated=true;
}
void PlayListWidget::populateVideoView() {
videoView->clear();
StorageInfo storageInfo;
const QList<FileSystem> &fs = storageInfo.fileSystems();
if(!videoScan ) {
scanForVideo();
}
QListIterator<DocLnk> Vdit( vFiles.children() );
- QListIterator<FileSystem> it ( fs );
+// QListIterator<FileSystem> it ( fs );
videoView->clear();
QString storage, pathName;
- for ( ; Vdit.current(); ++Vdit ) {
- for( ; it.current(); ++it ) {
- const QString name = (*it)->name();
- const QString path = (*it)->path();
- if( Vdit.current()->file().find(path) != -1 ) {
- storage=name;
- pathName=path;
- }
- }
+ for ( ; Vdit.current(); ++Vdit ) {
+// // for( ; it.current(); ++it ) {
+// const QString name = (*Vdit)->name();
+// const QString path = (*Vdit)->path();
+// if( Vdit.current()->file().find(path) != -1 ) {
+// storage=name;
+// pathName=path;
+// // }
+// }
QListViewItem * newItem;
if ( QFile( Vdit.current()->file() ).exists() ) {
newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(),
QString::number( QFile( Vdit.current()->file() ).size() ),
- storage, Vdit.current()->file());
+ ""/*storage*/, Vdit.current()->file());
newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) );
}
}
videoPopulated=true;
}
void PlayListWidget::openFile() {
// http://66.28.164.33:2080
// http://somafm.com/star0242.m3u
QString filename, name;
InputDialog *fileDlg;
fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0);
fileDlg->exec();
if( fileDlg->result() == 1 ) {
filename = fileDlg->text();
qDebug( "Selected filename is " + filename );
Om3u *m3uList;
DocLnk lnk;
Config cfg( "OpiePlayer" );
cfg.setGroup("PlayList");
if(filename.left(4) == "http") {
QString m3uFile, m3uFilePath;