Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 707f4d2..e9615f1 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -244,14 +244,12 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *, const QPoi } } void PlayListWidget::addAllToList() { -// QTime t; -// t.start(); audioView->populateView(); QListViewItemIterator audioIt( audioView ); DocLnk lnk; QString filename; @@ -270,34 +268,12 @@ void PlayListWidget::addAllToList() { filename = videoIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); } - // d->selectedFiles->addToSelection( ); - // if ( it.current()->isSelected() ) - // lst->append( audioIt.current() ); - // } - - -// if(!audioScan) -// scanForAudio(); -// if(!videoScan) -// scanForVideo(); - -// DocLnkSet filesAll; -// Global::findDocuments(&filesAll, "video/*;"+audioMimes); -// QListIterator<DocLnk> Adit( filesAll.children() ); -// for ( ; Adit.current(); ++Adit ) { -// if( QFileInfo( Adit.current()->file() ).exists() ) { -// d->selectedFiles->addToSelection( **Adit ); -// } -// } - - // qDebug("elapsed time %d", t.elapsed() ); - tabWidget->setCurrentPage(0); writeCurrentM3u(); d->selectedFiles->first(); } @@ -314,21 +290,12 @@ void PlayListWidget::addAllMusicToList() { filename = audioIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); } - /* if(!audioScan) - scanForAudio(); - QListIterator<DocLnk> dit( files.children() ); - for ( ; dit.current(); ++dit ) { - if( QFileInfo(dit.current()->file() ).exists() ) { - d->selectedFiles->addToSelection( **dit ); - } - } - */ tabWidget->setCurrentPage(0); writeCurrentM3u(); d->selectedFiles->first(); } @@ -342,23 +309,12 @@ void PlayListWidget::addAllVideoToList() { for ( ; videoIt.current(); ++videoIt ) { filename = videoIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); } - - - /* if(!videoScan) - scanForVideo(); - QListIterator<DocLnk> dit( vFiles.children() ); - for ( ; dit.current(); ++dit ) { - if( QFileInfo( dit.current()->file() ).exists() ) { - d->selectedFiles->addToSelection( **dit ); - } - } -*/ tabWidget->setCurrentPage(0); writeCurrentM3u(); d->selectedFiles->first(); } @@ -469,19 +425,16 @@ bool PlayListWidget::last() { writem3u(); } void PlayListWidget::loadList( const DocLnk & lnk) { QString name = lnk.name(); - // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<currentList is "+name); if( name.length()>0) { setCaption("OpiePlayer: "+name); -// qDebug("<<<<<<<<<<<<load list "+ lnk.file()); clearList(); -// readm3u(lnk.file()); readListFromFile(lnk.file()); tabWidget->setCurrentPage(0); } } void PlayListWidget::addSelected() { @@ -498,13 +451,12 @@ void PlayListWidget::addSelected() { d->selectedFiles->addToSelection( lnk ); } currentFileListView->clearSelection(); -// tabWidget->setCurrentPage( 0 ); writeCurrentM3u(); } void PlayListWidget::removeSelected() { d->selectedFiles->removeSelected( ); @@ -523,13 +475,12 @@ void PlayListWidget::playIt( QListViewItem *it) { void PlayListWidget::addToSelection( QListViewItem *it) { d->setDocumentUsed = FALSE; if(it) { if ( currentTab() == CurrentPlayList ) return; - // case 1: { DocLnk lnk; QString filename; filename=it->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name @@ -670,25 +621,23 @@ void PlayListWidget::openFile() { m3uFile=filename; m3uFile = m3uFile.right( m3uFile.length() - 7); } else{ m3uFile=filename; } -// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); lnk.setName( filename ); //sets name lnk.setFile( filename ); //sets file name // lnk.setIcon("opieplayer2/musicfile"); d->selectedFiles->addToSelection( lnk ); writeCurrentM3u(); d->selectedFiles->setSelectedItem( lnk.name()); } else if( filename.right( 3) == "m3u" || filename.right(3) == "pls" ) { readListFromFile( filename ); -// readPls( filename ); } else { lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); writeCurrentM3u(); d->selectedFiles->setSelectedItem( lnk.name()); @@ -734,66 +683,20 @@ void PlayListWidget::readListFromFile( const QString &filename ) { config.setGroup( "PlayList" ); config.writeEntry("CurrentPlaylist",filename); config.write(); currentPlayList=filename; -// m3uList->write(); m3uList->close(); delete m3uList; d->selectedFiles->setSelectedItem( s); setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); } -// /* -// reads pls and adds files/urls to playlist */ -// void PlayListWidget::readPls( const QString &filename ) { - -// qDebug( "pls filename is " + filename ); -// Om3u *m3uList; -// QString s, name; -// m3uList = new Om3u( filename, IO_ReadOnly ); -// m3uList->readPls(); - -// for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { -// s = *it; -// // s.replace( QRegExp( "%20" )," " ); -// DocLnk lnk( s ); -// QFileInfo f( s ); -// QString name = f.baseName(); - -// if( name.left( 4 ) == "http" ) { -// name = s.right( s.length() - 7); -// } else { -// name = s; -// } - -// name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); - -// lnk.setName( name ); -// if( s.at( s.length() - 4) == '.') {// if this is probably a file -// lnk.setFile( s ); -// } else { //if its a url -// // if( name.right( 1 ).find( '/' ) == -1) { -// // s += "/"; -// // } -// lnk.setFile( s ); -// } -// lnk.setType( "audio/x-mpegurl" ); - -// lnk.writeLink(); -// d->selectedFiles->addToSelection( lnk ); -// } - -// m3uList->close(); -// delete m3uList; -// } - -// /* // writes current playlist to current m3u file */ void PlayListWidget::writeCurrentM3u() { qDebug("writing to current m3u"); Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |