author | llornkcor <llornkcor> | 2002-10-08 18:31:28 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-10-08 18:31:28 (UTC) |
commit | 7599e0a20572d44ca805e6effb878601c707fd05 (patch) (side-by-side diff) | |
tree | 2bc2342b16338ca395528456705e38ede850d653 /noncore/multimedia/opieplayer2/om3u.cpp | |
parent | 9475b63d025c1ca386764784b7dad460935f45b0 (diff) | |
download | opie-7599e0a20572d44ca805e6effb878601c707fd05.zip opie-7599e0a20572d44ca805e6effb878601c707fd05.tar.gz opie-7599e0a20572d44ca805e6effb878601c707fd05.tar.bz2 |
more fixes
Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index c947033..0be727b 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp @@ -65,3 +65,3 @@ Om3u::~Om3u(){} -void Om3u::readM3u() { //it's m3u +void Om3u::readM3u() { // qDebug("<<<<<<reading m3u "+f.name()); @@ -71,3 +71,3 @@ void Om3u::readM3u() { //it's m3u s=t.readLine(); - // qDebug(s); + qDebug(s); if( s.find( "#", 0, TRUE) == -1 ) { @@ -84,7 +84,7 @@ void Om3u::readM3u() { //it's m3u QString name; - if( name.left( 4 ) == "http" ) { - name = s.right( s.length() - 7 ); - } else { +// if( name.left( 4 ) == "http" ) { +// name = s.right( s.length() - 7 ); +// } else { name = s; - } +// } append(name); @@ -139,3 +139,3 @@ void Om3u::write() { //writes list to m3u file f.writeBlock( list, list.length() ); - f.close(); +// f.close(); } @@ -147,2 +147,11 @@ void Om3u::add(const QString &filePath) { //adds to m3u file void Om3u::remove(const QString &filePath) { //removes from m3u list + QString list, currentFile; + for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { + currentFile=*it; +// qDebug(*it); + + if( filePath != currentFile) + list += currentFile+"\n"; + } + f.writeBlock( list, list.length() ); @@ -151,2 +160,4 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list void Om3u::deleteFile(const QString &filePath) {//deletes m3u file + f.close(); + f.remove(); |