-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index c35e03d..a65495e 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp @@ -55,9 +55,9 @@ #include <stdlib.h> #include <assert.h> PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* parent, const char* name ) - : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) + : PlayListWidgetGui( mediaPlayerState, parent, name ) , currentFileListView( 0 ) { d->tbAddToList = new ToolButton( bar, tr( "Add to Playlist" ), "opieplayer2/add_to_playlist", @@ -100,15 +100,15 @@ PlayListWidget::PlayListWidget( MediaPlayerState &mediaPlayerState, QWidget* par bool b= cfg.readBoolEntry("FullScreen", 0); mediaPlayerState.setFullscreen( b ); pmView->setItemChecked( -16, b ); - (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", + (void)new ToolButton( vbox1, tr( "Move Up" ), "opieplayer2/up", d->selectedFiles, SLOT(moveSelectedUp() ) ); - (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", + (void)new ToolButton( vbox1, tr( "Remove" ), "opieplayer2/cut", d->selectedFiles, SLOT(removeSelected() ) ); (void)new ToolButton( vbox1, tr( "Move Down" ), "opieplayer2/down", d->selectedFiles, SLOT(moveSelectedDown() ) ); - // QVBox *stretch2 = new QVBox( vbox1 ); + QVBox *stretch2 = new QVBox( vbox1 ); connect( tbDeletePlaylist, ( SIGNAL( released() ) ), SLOT( deletePlaylist() ) ); connect( pmView, SIGNAL( activated( int ) ), @@ -187,9 +187,9 @@ void PlayListWidget::writeDefaultPlaylist() { m3uList->write(); m3uList->close(); delete m3uList; - + } } } @@ -198,9 +198,9 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { if( QFileInfo( lnk.file() ).exists() || lnk.file().left(4) == "http" ) { d->selectedFiles->addToSelection( lnk ); } -// writeCurrentM3u(); +// writeCurrentM3u(); } void PlayListWidget::clearList() { @@ -260,9 +260,9 @@ void PlayListWidget::addAllToList() { filename = audioIt.current()->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); - } + } videoView->populateView(); QListViewItemIterator videoIt( videoView ); @@ -270,19 +270,19 @@ 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) +// if(!videoScan) // scanForVideo(); // DocLnkSet filesAll; // Global::findDocuments(&filesAll, "video/*;"+audioMimes); @@ -295,9 +295,9 @@ void PlayListWidget::addAllToList() { // qDebug("elapsed time %d", t.elapsed() ); tabWidget->setCurrentPage(0); - + writeCurrentM3u(); d->selectedFiles->first(); } @@ -314,9 +314,9 @@ 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() ); @@ -343,9 +343,9 @@ void PlayListWidget::addAllVideoToList() { 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(); @@ -354,11 +354,11 @@ void PlayListWidget::addAllVideoToList() { if( QFileInfo( dit.current()->file() ).exists() ) { d->selectedFiles->addToSelection( **dit ); } } -*/ +*/ tabWidget->setCurrentPage(0); - writeCurrentM3u(); + writeCurrentM3u(); d->selectedFiles->first(); } @@ -382,10 +382,10 @@ void PlayListWidget::setDocument( const QString& fileref ) { readPls( DocLnk( fileref).file() ); } else { clearList(); addToSelection( DocLnk( fileref ) ); - writeCurrentM3u(); - + writeCurrentM3u(); + d->setDocumentUsed = TRUE; mediaPlayerState.setPlaying( FALSE ); mediaPlayerState.setPlaying( TRUE ); } @@ -504,9 +504,9 @@ void PlayListWidget::addSelected() { void PlayListWidget::removeSelected() { d->selectedFiles->removeSelected( ); - writeCurrentM3u(); + writeCurrentM3u(); } void PlayListWidget::playIt( QListViewItem *it) { @@ -530,12 +530,12 @@ void PlayListWidget::addToSelection( QListViewItem *it) { filename=it->text(3); lnk.setName( QFileInfo(filename).baseName() ); //sets name lnk.setFile( filename ); //sets file name d->selectedFiles->addToSelection( lnk); - - writeCurrentM3u(); + + writeCurrentM3u(); // tabWidget->setCurrentPage(0); - + } } @@ -692,15 +692,15 @@ void PlayListWidget::openFile() { writeCurrentM3u(); d->selectedFiles->setSelectedItem( lnk.name()); } } - + delete fileDlg; } /* reads m3u and shows files/urls to playlist widget */ -void PlayListWidget::readm3u( const QString &filename ) { +void PlayListWidget::readm3u( const QString &filename ) { qDebug( "read m3u filename " + filename ); Om3u *m3uList; QString s, name; @@ -713,14 +713,14 @@ void PlayListWidget::readm3u( const QString &filename ) { if(s.left(4)=="http") { lnk.setName( s ); //sets file name lnk.setIcon("opieplayer2/musicfile"); lnk.setFile( s ); //sets file name - + } else { // if( QFileInfo( s ).exists() ) { lnk.setName( QFileInfo(s).baseName()); // if(s.right(4) == '.') {//if regular file - if(s.left(1) != "/") { + if(s.left(1) != "/") { // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); // lnk.setIcon(MimeType(s).pixmap() ); // lnk.setIcon("SoundPlayer"); @@ -745,9 +745,9 @@ void PlayListWidget::readm3u( const QString &filename ) { delete m3uList; d->selectedFiles->setSelectedItem( s); setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); - + } /* reads pls and adds files/urls to playlist */ @@ -814,9 +814,9 @@ void PlayListWidget::writeCurrentM3u() { m3uList->write(); m3uList->close(); } delete m3uList; - + } /* writes current playlist to m3u file */ @@ -849,9 +849,9 @@ void PlayListWidget::writem3u() { // qDebug( list ); m3uList->write(); m3uList->close(); delete m3uList; - + delete fileDlg; DocLnk lnk; lnk.setFile( filename); @@ -860,9 +860,9 @@ void PlayListWidget::writem3u() { // qDebug(filename); Config config( "OpiePlayer" ); config.setGroup( "PlayList" ); - + config.writeEntry("CurrentPlaylist",filename); currentPlayList=filename; if(!lnk.writeLink()) { |