author | llornkcor <llornkcor> | 2002-06-19 13:43:27 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-19 13:43:27 (UTC) |
commit | 110eeb8d44d3065c066a29931761371928df49c4 (patch) (side-by-side diff) | |
tree | 527910aac86ed61e0c2d7d1c885300d841a632ba | |
parent | 94f27897d74d0553bb7a5614f7da0603d490533e (diff) | |
download | opie-110eeb8d44d3065c066a29931761371928df49c4.zip opie-110eeb8d44d3065c066a29931761371928df49c4.tar.gz opie-110eeb8d44d3065c066a29931761371928df49c4.tar.bz2 |
fixed problem with writing doclnk, and local files in an m3u
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 2323ac2..eeaed33 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp @@ -840,33 +840,34 @@ void PlayListWidget::tabChanged(QWidget *widg) { { if( tbDeletePlaylist->isHidden()) tbDeletePlaylist->show(); playLists->reread(); } break; }; } void PlayListWidget::btnPlay(bool b) { // mediaPlayerState->setPlaying(b); switch ( tabWidget->currentPageIndex()) { case 0: { qDebug("here we are"); - if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 || d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { + if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 + || d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { QMessageBox::message("Note","You are trying to play\na malformed url."); } else { mediaPlayerState->setPlaying(b); } } break; case 1: { addToSelection( audioView->currentItem() ); mediaPlayerState->setPlaying(b); d->selectedFiles->removeSelected( ); tabWidget->setCurrentPage(1); d->selectedFiles->unSelect(); insanityBool=FALSE; }// audioView->clearSelection(); @@ -1220,46 +1221,55 @@ void PlayListWidget::readm3u(const QString &filename) { // Lview->insertLine(t.readLine(),-1); s=t.readLine(); if(s.find(" ",0,TRUE) != -1 || s.find("%20",0,TRUE) != -1) { QMessageBox::message("Note","Spaces in urls are not allowed."); } else if(s.find("#",0,TRUE) == -1) { if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat if(s.left(2) == "E:" || s.left(2) == "P:") { s=s.right(s.length()-2); DocLnk lnk( s ); QFileInfo f(s); QString name = f.baseName(); name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); lnk.setName( name); s=s.replace( QRegExp("\\"),"/"); lnk.setFile( s); + lnk.writeLink(); // lnk.setIcon(opieplayer/MPEGPlayer); qDebug("add "+name); d->selectedFiles->addToSelection( lnk); } else { // is url s.replace(QRegExp("%20")," "); DocLnk lnk( s); - QString name = s.right( s.length() - 7); + QString name; + if(name.left(4)=="http") + name = s.right( s.length() - 7); + else + name=s; // name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); lnk.setName(name); + if(s.at(s.length()-4) == '.') + lnk.setFile( s); + else lnk.setFile( s+"/"); // lnk.setFile( filename); // lnk.setComment( s+"/"); lnk.setType("audio/x-mpegurl"); + lnk.writeLink(); // lnk.setIcon( "opieplayer/MPEGPlayer"); // qDebug("add "+s); d->selectedFiles->addToSelection( lnk); } i++; } } } } f.close(); } void PlayListWidget::writem3u(const QString &filename) { } |