summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/om3u.cpp
authorllornkcor <llornkcor>2002-10-08 02:01:16 (UTC)
committer llornkcor <llornkcor>2002-10-08 02:01:16 (UTC)
commit40e9c78666e74221e06329bb07dfd66648b2727b (patch) (unidiff)
treeafccf992024cc56a64d8495d80ce10478f946478 /noncore/multimedia/opieplayer2/om3u.cpp
parentc43b5d600a7d1dcaadcba2cb047a60313b37f2f2 (diff)
downloadopie-40e9c78666e74221e06329bb07dfd66648b2727b.zip
opie-40e9c78666e74221e06329bb07dfd66648b2727b.tar.gz
opie-40e9c78666e74221e06329bb07dfd66648b2727b.tar.bz2
fixed m3u handling
Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp
index d378145..c947033 100644
--- a/noncore/multimedia/opieplayer2/om3u.cpp
+++ b/noncore/multimedia/opieplayer2/om3u.cpp
@@ -45,34 +45,35 @@
45#include <qtextstream.h> 45#include <qtextstream.h>
46#include <qstringlist.h> 46#include <qstringlist.h>
47#include <qcstring.h> 47#include <qcstring.h>
48 48
49//extern PlayListWidget *playList; 49//extern PlayListWidget *playList;
50 50
51Om3u::Om3u( const QString &filePath) 51Om3u::Om3u( const QString &filePath, int mode)
52 : QStringList (){ 52 : QStringList (){
53//filePath is path name to m3u 53//filePath is path name to m3u
54//qDebug("<<<<<<<new m3u "+filePath); 54//qDebug("<<<<<<<new m3u "+filePath);
55 f.setName(filePath); 55 f.setName(filePath);
56 if(f.exists()) 56// if(f.exists())
57 f.open( IO_ReadWrite ); 57// f.open( IO_ReadWrite);
58 else 58// else
59 f.open( IO_ReadWrite | IO_Truncate); 59// f.open( IO_ReadWrite | IO_Truncate);
60 f.open(mode);
61
60} 62}
61 63
62Om3u::~Om3u(){} 64Om3u::~Om3u(){}
63 65
64void Om3u::readM3u() { //it's m3u 66void Om3u::readM3u() { //it's m3u
65// qDebug("<<<<<<reading m3u "+f.name()); 67// qDebug("<<<<<<reading m3u "+f.name());
66 QTextStream t(&f); 68 QTextStream t(&f);
67 QString s; 69 QString s;
68 while ( !t.atEnd() ) { 70 while ( !t.atEnd() ) {
69 s=t.readLine(); 71 s=t.readLine();
70 72 // qDebug(s);
71 if( s.find( "#", 0, TRUE) == -1 ) { 73 if( s.find( "#", 0, TRUE) == -1 ) {
72 if( s.find( " ", 0, TRUE) == -1 ) {
73 if( s.left(2) == "E:" || s.left(2) == "P:" ) { 74 if( s.left(2) == "E:" || s.left(2) == "P:" ) {
74 s = s.right( s.length() -2 ); 75 s = s.right( s.length() -2 );
75 QFileInfo f( s ); 76 QFileInfo f( s );
76 QString name = f.baseName(); 77 QString name = f.baseName();
77 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); 78 name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 );
78 s=s.replace( QRegExp( "\\" ), "/" ); 79 s=s.replace( QRegExp( "\\" ), "/" );
@@ -86,13 +87,12 @@ void Om3u::readM3u() { //it's m3u
86 } else { 87 } else {
87 name = s; 88 name = s;
88 } 89 }
89 append(name); 90 append(name);
90// qDebug(name); 91// qDebug(name);
91 } 92 }
92 }
93 } 93 }
94 } 94 }
95} 95}
96 96
97void Om3u::readPls() { //it's a pls file 97void Om3u::readPls() { //it's a pls file
98 QTextStream t( &f ); 98 QTextStream t( &f );