Diffstat (limited to 'core/multimedia/opieplayer/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index 3541e5f..8b92a8c 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp | |||
@@ -48,8 +48,8 @@ | |||
48 | 48 | ||
49 | static inline QString fullBaseName ( const QFileInfo &fi ) | 49 | static inline QString fullBaseName ( const QFileInfo &fi ) |
50 | { | 50 | { |
51 | QString str = fi. fileName ( ); | 51 | QString str = fi. fileName ( ); |
52 | return str. left ( str. findRev ( '.' )); | 52 | return str. left ( str. findRev ( '.' )); |
53 | } | 53 | } |
54 | 54 | ||
55 | 55 | ||
@@ -66,33 +66,33 @@ Om3u::~Om3u(){} | |||
66 | 66 | ||
67 | void Om3u::readM3u() { | 67 | void Om3u::readM3u() { |
68 | // qDebug("<<<<<<reading m3u "+f.name()); | 68 | // qDebug("<<<<<<reading m3u "+f.name()); |
69 | QTextStream t(&f); | 69 | QTextStream t(&f); |
70 | QString s; | 70 | QString s; |
71 | while ( !t.atEnd() ) { | 71 | while ( !t.atEnd() ) { |
72 | s=t.readLine(); | 72 | s=t.readLine(); |
73 | qDebug(s); | 73 | // qDebug(s); |
74 | if( s.find( "#", 0, TRUE) == -1 ) { | 74 | if( s.find( "#", 0, TRUE) == -1 ) { |
75 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { | 75 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { |
76 | s = s.right( s.length() -2 ); | 76 | s = s.right( s.length() -2 ); |
77 | QFileInfo f( s ); | 77 | QFileInfo f( s ); |
78 | QString name = fullBaseName ( f ); | 78 | QString name = fullBaseName ( f ); |
79 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 79 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
80 | s=s.replace( QRegExp( "\\" ), "/" ); | 80 | s=s.replace( QRegExp( "\\" ), "/" ); |
81 | append(s); | 81 | append(s); |
82 | // qDebug(s); | 82 | // qDebug(s); |
83 | } else { // is url | 83 | } else { // is url |
84 | s.replace( QRegExp( "%20" )," " ); | 84 | s.replace( QRegExp( "%20" )," " ); |
85 | QString name; | 85 | QString name; |
86 | // if( name.left( 4 ) == "http" ) { | 86 | // if( name.left( 4 ) == "http" ) { |
87 | // name = s.right( s.length() - 7 ); | 87 | // name = s.right( s.length() - 7 ); |
88 | // } else { | 88 | // } else { |
89 | name = s; | 89 | name = s; |
90 | // } | 90 | // } |
91 | append(name); | 91 | append(name); |
92 | // qDebug(name); | 92 | // qDebug(name); |
93 | } | 93 | } |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | void Om3u::readPls() { //it's a pls file | 98 | void Om3u::readPls() { //it's a pls file |
@@ -135,7 +135,7 @@ void Om3u::write() { //writes list to m3u file | |||
135 | QString list; | 135 | QString list; |
136 | if(count()>0) { | 136 | if(count()>0) { |
137 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 137 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
138 | qDebug(*it); | 138 | // qDebug(*it); |
139 | list += *it+"\n"; | 139 | list += *it+"\n"; |
140 | } | 140 | } |
141 | f.writeBlock( list, list.length() ); | 141 | f.writeBlock( list, list.length() ); |