Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index f9192e8..7ada5ee 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -464,5 +464,5 @@ void PlayListWidget::addSelected() { | |||
464 | } | 464 | } |
465 | } | 465 | } |
466 | tabWidget->setCurrentPage(0); | 466 | // tabWidget->setCurrentPage(0); |
467 | writeCurrentM3u(); | 467 | writeCurrentM3u(); |
468 | } | 468 | } |
@@ -484,5 +484,5 @@ void PlayListWidget::addSelected() { | |||
484 | } | 484 | } |
485 | } | 485 | } |
486 | tabWidget->setCurrentPage(0); | 486 | // tabWidget->setCurrentPage(0); |
487 | writeCurrentM3u(); | 487 | writeCurrentM3u(); |
488 | } | 488 | } |
@@ -769,22 +769,28 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
769 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 769 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
770 | s = *it; | 770 | s = *it; |
771 | // s.replace( QRegExp( "%20" )," " ); | ||
772 | // qDebug("reading "+ s); | 771 | // qDebug("reading "+ s); |
773 | if(s.left(4)=="http") { | 772 | if(s.left(4)=="http") { |
774 | lnk.setName( s ); //sets file name | 773 | lnk.setName( s ); //sets file name |
774 | lnk.setIcon("opieplayer2/musicfile"); | ||
775 | if(s.right(4) != '.' || s.right(5) != '.') | ||
776 | lnk.setFile( s+"/"); //if url with no extension | ||
777 | else | ||
775 | lnk.setFile( s ); //sets file name | 778 | lnk.setFile( s ); //sets file name |
776 | lnk.setIcon("opieplayer2/musicfile"); | 779 | |
780 | } else { | ||
781 | // if( QFileInfo( s ).exists() ) { | ||
782 | lnk.setName( QFileInfo(s).baseName()); | ||
783 | // if(s.right(4) == '.') {//if regular file | ||
784 | if(s.left(1) != "/") { | ||
785 | // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s); | ||
786 | lnk.setFile( QFileInfo(filename).dirPath()+"/"+s); | ||
787 | lnk.setIcon("SoundPlayer"); | ||
788 | } else { | ||
789 | // qDebug("set link2 "+s); | ||
790 | lnk.setFile( s); | ||
791 | lnk.setIcon("SoundPlayer"); | ||
792 | } | ||
777 | } | 793 | } |
778 | else { | 794 | d->selectedFiles->addToSelection( lnk ); |
779 | if( QFileInfo( s ).exists() ) { | ||
780 | lnk.setName( QFileInfo(s).baseName()); | ||
781 | // qDebug("set link "+s); | ||
782 | if(s.at(s.length()-4) == '.') //if regular file | ||
783 | lnk.setFile( s); | ||
784 | else | ||
785 | lnk.setFile( s+"/"); //if url with no extension | ||
786 | } | ||
787 | } | ||
788 | d->selectedFiles->addToSelection( lnk ); | ||
789 | } | 795 | } |
790 | Config config( "OpiePlayer" ); | 796 | Config config( "OpiePlayer" ); |
@@ -860,8 +866,6 @@ void PlayListWidget::writeCurrentM3u() { | |||
860 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 866 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
861 | 867 | ||
862 | |||
863 | qDebug( d->selectedFiles->current()->file()); | ||
864 | do { | 868 | do { |
865 | qDebug( d->selectedFiles->current()->file()); | 869 | qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); |
866 | m3uList->add( d->selectedFiles->current()->file() ); | 870 | m3uList->add( d->selectedFiles->current()->file() ); |
867 | } | 871 | } |