summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/om3u.cpp
Side-by-side diff
Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp25
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();