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(){} | |||
65 | 65 | ||
66 | void Om3u::readM3u() { //it's m3u | 66 | void Om3u::readM3u() { |
67 | // qDebug("<<<<<<reading m3u "+f.name()); | 67 | // qDebug("<<<<<<reading m3u "+f.name()); |
@@ -71,3 +71,3 @@ void Om3u::readM3u() { //it's m3u | |||
71 | s=t.readLine(); | 71 | s=t.readLine(); |
72 | // qDebug(s); | 72 | qDebug(s); |
73 | if( s.find( "#", 0, TRUE) == -1 ) { | 73 | if( s.find( "#", 0, TRUE) == -1 ) { |
@@ -84,7 +84,7 @@ void Om3u::readM3u() { //it's m3u | |||
84 | QString name; | 84 | QString name; |
85 | if( name.left( 4 ) == "http" ) { | 85 | // if( name.left( 4 ) == "http" ) { |
86 | name = s.right( s.length() - 7 ); | 86 | // name = s.right( s.length() - 7 ); |
87 | } else { | 87 | // } else { |
88 | name = s; | 88 | name = s; |
89 | } | 89 | // } |
90 | append(name); | 90 | append(name); |
@@ -139,3 +139,3 @@ void Om3u::write() { //writes list to m3u file | |||
139 | f.writeBlock( list, list.length() ); | 139 | f.writeBlock( list, list.length() ); |
140 | f.close(); | 140 | // f.close(); |
141 | } | 141 | } |
@@ -147,2 +147,11 @@ void Om3u::add(const QString &filePath) { //adds to m3u file | |||
147 | void Om3u::remove(const QString &filePath) { //removes from m3u list | 147 | void Om3u::remove(const QString &filePath) { //removes from m3u list |
148 | QString list, currentFile; | ||
149 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | ||
150 | currentFile=*it; | ||
151 | // qDebug(*it); | ||
152 | |||
153 | if( filePath != currentFile) | ||
154 | list += currentFile+"\n"; | ||
155 | } | ||
156 | f.writeBlock( list, list.length() ); | ||
148 | 157 | ||
@@ -151,2 +160,4 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list | |||
151 | void Om3u::deleteFile(const QString &filePath) {//deletes m3u file | 160 | void Om3u::deleteFile(const QString &filePath) {//deletes m3u file |
161 | f.close(); | ||
162 | f.remove(); | ||
152 | 163 | ||