author | llornkcor <llornkcor> | 2002-10-15 01:38:28 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-15 01:38:28 (UTC) |
commit | 42ed74a1af7f96c06d2310b9804dacc703e31ad9 (patch) (unidiff) | |
tree | e1becb85cbf0501740f011913ad87132d235c729 /noncore/multimedia | |
parent | e0efd37513192d9a17fa9a9f46bbaed0ca38029c (diff) | |
download | opie-42ed74a1af7f96c06d2310b9804dacc703e31ad9.zip opie-42ed74a1af7f96c06d2310b9804dacc703e31ad9.tar.gz opie-42ed74a1af7f96c06d2310b9804dacc703e31ad9.tar.bz2 |
fix for m3u files with spaces.. damn things.. who knows whats in that damn empty space.. really
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 32 |
1 files changed, 18 insertions, 14 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 | |||
@@ -465,3 +465,3 @@ void PlayListWidget::addSelected() { | |||
465 | } | 465 | } |
466 | tabWidget->setCurrentPage(0); | 466 | // tabWidget->setCurrentPage(0); |
467 | writeCurrentM3u(); | 467 | writeCurrentM3u(); |
@@ -485,3 +485,3 @@ void PlayListWidget::addSelected() { | |||
485 | } | 485 | } |
486 | tabWidget->setCurrentPage(0); | 486 | // tabWidget->setCurrentPage(0); |
487 | writeCurrentM3u(); | 487 | writeCurrentM3u(); |
@@ -770,3 +770,2 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
770 | s = *it; | 770 | s = *it; |
771 | // s.replace( QRegExp( "%20" )," " ); | ||
772 | // qDebug("reading "+ s); | 771 | // qDebug("reading "+ s); |
@@ -774,13 +773,20 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
774 | lnk.setName( s ); //sets file name | 773 | lnk.setName( s ); //sets file name |
775 | lnk.setFile( s ); //sets file name | ||
776 | lnk.setIcon("opieplayer2/musicfile"); | 774 | lnk.setIcon("opieplayer2/musicfile"); |
777 | } | 775 | if(s.right(4) != '.' || s.right(5) != '.') |
778 | else { | 776 | lnk.setFile( s+"/"); //if url with no extension |
779 | if( QFileInfo( s ).exists() ) { | 777 | else |
778 | lnk.setFile( s ); //sets file name | ||
779 | |||
780 | } else { | ||
781 | // if( QFileInfo( s ).exists() ) { | ||
780 | lnk.setName( QFileInfo(s).baseName()); | 782 | lnk.setName( QFileInfo(s).baseName()); |
781 | // qDebug("set link "+s); | 783 | // if(s.right(4) == '.') {//if regular file |
782 | if(s.at(s.length()-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); | ||
783 | lnk.setFile( s); | 790 | lnk.setFile( s); |
784 | else | 791 | lnk.setIcon("SoundPlayer"); |
785 | lnk.setFile( s+"/"); //if url with no extension | ||
786 | } | 792 | } |
@@ -861,6 +867,4 @@ void PlayListWidget::writeCurrentM3u() { | |||
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() ); |