author | llornkcor <llornkcor> | 2002-04-20 18:29:06 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-04-20 18:29:06 (UTC) |
commit | 758c9e817087252894b15c6f7476c1f16a02f65d (patch) (side-by-side diff) | |
tree | de3a2fa88c3eeffae5602928b3a57c8f9ac2ac86 | |
parent | b37f1e1eec635165da7dbf06e968cd5368d92d4e (diff) | |
download | opie-758c9e817087252894b15c6f7476c1f16a02f65d.zip opie-758c9e817087252894b15c6f7476c1f16a02f65d.tar.gz opie-758c9e817087252894b15c6f7476c1f16a02f65d.tar.bz2 |
file/url
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 11f9752..4b1ff22 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -893,113 +893,111 @@ void PlayListWidget::listDelete() { // Global::findDocuments(&files, "audio/*"); // AppLnkSet appFiles; QListIterator<DocLnk> dit( files.children() ); for ( ; dit.current(); ++dit ) { if( dit.current()->name() == file) { // qDebug(file); LnkProperties prop( dit.current() ); // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); prop.showMaximized(); prop.exec(); } } populateAudioView(); } break; case 2: { // file = videoView->selectedItem()->text(0); // for ( int i = 0; i < noOfFiles; i++ ) { // QString entryName; // entryName.sprintf( "File%i", i + 1 ); // QString linkFile = cfg.readEntry( entryName ); // AppLnk lnk( AppLnk(linkFile)); // if( lnk.name() == file ) { // LnkProperties prop( &lnk); // // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); // prop.showMaximized(); // prop.exec(); // } // } } break; }; } void PlayListWidget::populateAudioView() { // if(files) // files.~DocLnkSet(); StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); Global::findDocuments(&files, "audio/*"); QListIterator<DocLnk> dit( files.children() ); 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; } QListViewItem * newItem; if ( QFile( dit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/musicfile" )); } } } void PlayListWidget::populateVideoView() { StorageInfo storageInfo; const QList<FileSystem> &fs = storageInfo.fileSystems(); Global::findDocuments(&vFiles, "video/*"); QListIterator<DocLnk> Vdit( vFiles.children() ); QListIterator<FileSystem> it ( fs ); videoView->clear(); QString storage; 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; } QListViewItem * newItem; if ( QFile( Vdit.current()->file()).exists() ) { newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), QString::number( QFile( Vdit.current()->file()).size() ), storage); newItem->setPixmap(0, Resource::loadPixmap( "mpegplayer/videofile" )); } } } void PlayListWidget::openFile() { QString filename; InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->LineEdit1->text(); } qDebug(filename); DocLnk lnk; QString name = filename.right(filename.length()-filename.find("http://")-7); + qDebug(name); lnk.setName( name); //sets file name // lnk.setComment(); lnk.setFile(filename); //sets File property // problem is, the launcher sees this as a broken link and does not display it :( - lnk.setType("audio/x-mpegurl"); lnk.setExec("opieplayer"); lnk.setIcon("opieplayer/MPEGPlayer"); - QString cmd="touch "+QPEApplication::documentDir()+"audio/x-mpegurl/"+name; - system( cmd.latin1()); -// d->selectedFiles->addToSelection( **dit ); if(!lnk.writeLink()) qDebug("Writing doclink did not work"); + d->selectedFiles->addToSelection( lnk); if(fileDlg) delete fileDlg; } |