summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-15 01:38:28 (UTC)
committer llornkcor <llornkcor>2002-10-15 01:38:28 (UTC)
commit42ed74a1af7f96c06d2310b9804dacc703e31ad9 (patch) (side-by-side diff)
treee1becb85cbf0501740f011913ad87132d235c729
parente0efd37513192d9a17fa9a9f46bbaed0ca38029c (diff)
downloadopie-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
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp32
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
@@ -462,9 +462,9 @@ void PlayListWidget::addSelected() {
}
}
}
}
- tabWidget->setCurrentPage(0);
+// tabWidget->setCurrentPage(0);
writeCurrentM3u();
}
break;
case 2: { // video
@@ -482,9 +482,9 @@ void PlayListWidget::addSelected() {
}
}
}
}
- tabWidget->setCurrentPage(0);
+// tabWidget->setCurrentPage(0);
writeCurrentM3u();
}
break;
};
@@ -767,23 +767,29 @@ void PlayListWidget::readm3u( const QString &filename ) {
m3uList->readM3u();
DocLnk lnk;
for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) {
s = *it;
-// s.replace( QRegExp( "%20" )," " );
// qDebug("reading "+ s);
if(s.left(4)=="http") {
lnk.setName( s ); //sets file name
- lnk.setFile( s ); //sets file name
lnk.setIcon("opieplayer2/musicfile");
- }
- else {
- if( QFileInfo( s ).exists() ) {
+ if(s.right(4) != '.' || s.right(5) != '.')
+ lnk.setFile( s+"/"); //if url with no extension
+ else
+ lnk.setFile( s ); //sets file name
+
+ } else {
+ // if( QFileInfo( s ).exists() ) {
lnk.setName( QFileInfo(s).baseName());
-// qDebug("set link "+s);
- if(s.at(s.length()-4) == '.') //if regular file
+ // if(s.right(4) == '.') {//if regular file
+ if(s.left(1) != "/") {
+ // qDebug("set link "+QFileInfo(filename).dirPath()+"/"+s);
+ lnk.setFile( QFileInfo(filename).dirPath()+"/"+s);
+ lnk.setIcon("SoundPlayer");
+ } else {
+ // qDebug("set link2 "+s);
lnk.setFile( s);
- else
- lnk.setFile( s+"/"); //if url with no extension
+ lnk.setIcon("SoundPlayer");
}
}
d->selectedFiles->addToSelection( lnk );
}
@@ -858,12 +864,10 @@ void PlayListWidget::writeCurrentM3u() {
if( d->selectedFiles->first()) {
Om3u *m3uList;
m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate );
-
- qDebug( d->selectedFiles->current()->file());
do {
- qDebug( d->selectedFiles->current()->file());
+ qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file());
m3uList->add( d->selectedFiles->current()->file() );
}
while ( d->selectedFiles->next() );
qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" );