author | llornkcor <llornkcor> | 2002-06-26 23:50:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-26 23:50:27 (UTC) |
commit | a86c09e8a12b504471ffeb8966e34a79dd8518b5 (patch) (unidiff) | |
tree | bea361029616edb533136880b973dae4a7e7315e /core/multimedia/opieplayer/playlistwidget.cpp | |
parent | b13d95b210c7d16229514afc66e32a1de09a075c (diff) | |
download | opie-a86c09e8a12b504471ffeb8966e34a79dd8518b5.zip opie-a86c09e8a12b504471ffeb8966e34a79dd8518b5.tar.gz opie-a86c09e8a12b504471ffeb8966e34a79dd8518b5.tar.bz2 |
fixed error parsing pls where the url's already have a trailing /, and took out muting for now
Diffstat (limited to 'core/multimedia/opieplayer/playlistwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 0332237..4926287 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1317,36 +1317,41 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1317 | qDebug("adding "+s+" to playlist"); | 1317 | qDebug("adding "+s+" to playlist"); |
1318 | // numberofentries=2 | 1318 | // numberofentries=2 |
1319 | // File1=http | 1319 | // File1=http |
1320 | // Title | 1320 | // Title |
1321 | // Length | 1321 | // Length |
1322 | // Version | 1322 | // Version |
1323 | // File2=http | 1323 | // File2=http |
1324 | 1324 | ||
1325 | s=s.replace( QRegExp("\\"),"/"); | 1325 | s=s.replace( QRegExp("\\"),"/"); |
1326 | DocLnk lnk( s ); | 1326 | DocLnk lnk( s ); |
1327 | QFileInfo f(s); | 1327 | QFileInfo f(s); |
1328 | QString name = f.baseName(); | 1328 | QString name = f.baseName(); |
1329 | if(name.left(4)=="http") | 1329 | if(name.left(4)=="http") |
1330 | name = s.right( s.length() - 7); | 1330 | name = s.right( s.length() - 7); |
1331 | else | 1331 | else |
1332 | name=s; | 1332 | name=s; |
1333 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1333 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1334 | // QFileInfo f(s); | 1334 | // QFileInfo f(s); |
1335 | // QString name = f.baseName(); | 1335 | // QString name = f.baseName(); |
1336 | // name = name.left(name.length()-4); | 1336 | // name = name.left(name.length()-4); |
1337 | // name = name.right(name.findRev("/",0,TRUE)); | 1337 | // name = name.right(name.findRev("/",0,TRUE)); |
1338 | lnk.setName( name); | 1338 | lnk.setName( name); |
1339 | if(s.at(s.length()-4) == '.') | 1339 | if(s.at(s.length()-4) == '.') |
1340 | lnk.setFile( s); | 1340 | lnk.setFile( s); |
1341 | else | 1341 | else { |
1342 | lnk.setFile( s+"/"); | 1342 | if( name.right(1).find('/') == -1) |
1343 | s+="/"; | ||
1344 | // if(s.right(1) != '/') | ||
1345 | lnk.setFile( s); | ||
1346 | |||
1347 | } | ||
1343 | lnk.setType("audio/x-mpegurl"); | 1348 | lnk.setType("audio/x-mpegurl"); |
1344 | 1349 | ||
1345 | qDebug("DocLnk add "+name); | 1350 | qDebug("DocLnk add "+name); |
1346 | d->selectedFiles->addToSelection( lnk); | 1351 | d->selectedFiles->addToSelection( lnk); |
1347 | } | 1352 | } |
1348 | } | 1353 | } |
1349 | i++; | 1354 | i++; |
1350 | } | 1355 | } |
1351 | } | 1356 | } |
1352 | 1357 | ||