-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index 95ed03c..7149a8e 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp @@ -92,73 +92,73 @@ void Om3u::readPls() { //it's a pls file while ( !t.atEnd() ) { s = t.readLine(); if( s.left(4) == "File" ) { s = s.right( s.length() - 6 ); s.replace( QRegExp( "%20" )," "); // odebug << "adding " + s + " to playlist" << oendl; // numberofentries=2 // File1=http // Title // Length // Version // File2=http s = s.replace( QRegExp( "\\" ), "/" ); QFileInfo f( s ); QString name = fullBaseName ( f ); if( name.left( 4 ) == "http" ) { name = s.right( s.length() - 7); } else { name = s; } name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); if( s.at( s.length() - 4) == '.') // if this is probably a file append(s); else { //if its a url if( name.right( 1 ).find( '/' ) == -1) { s += "/"; } append(s); } } } } void Om3u::write() { //writes list to m3u file QString list; QTextStream t(&f); t.setEncoding(QTextStream::UnicodeUTF8); if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { // odebug << *it << oendl; t << *it << "\n"; } } // f.close(); } void Om3u::add(const QString &filePath) { //adds to m3u file append(filePath); } void Om3u::remove(const QString &filePath) { //removes from m3u list QString list, currentFile; if(count()>0) { for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { currentFile=*it; // odebug << *it << oendl; if( filePath != currentFile) list += currentFile+"\n"; } f.writeBlock( list, list.length() ); } } -void Om3u::deleteFile(const QString &filePath) {//deletes m3u file +void Om3u::deleteFile(const QString &) {//deletes m3u file f.close(); f.remove(); } void Om3u::close() { //closes m3u file f.close(); } |