Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 7183fb4..69e87e7 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp | |||
@@ -60,7 +60,8 @@ Om3u::~Om3u(){} | |||
60 | void Om3u::readM3u() { | 60 | void Om3u::readM3u() { |
61 | // qDebug("<<<<<<reading m3u "+f.name()); | 61 | // qDebug("<<<<<<reading m3u "+f.name()); |
62 | QTextStream t(&f); | 62 | QTextStream t(&f); |
63 | QString s; | 63 | t.setEncoding(QTextStream::UnicodeUTF8); |
64 | QString s; | ||
64 | while ( !t.atEnd() ) { | 65 | while ( !t.atEnd() ) { |
65 | s=t.readLine(); | 66 | s=t.readLine(); |
66 | // qDebug(s); | 67 | // qDebug(s); |
@@ -84,7 +85,8 @@ void Om3u::readM3u() { | |||
84 | 85 | ||
85 | void Om3u::readPls() { //it's a pls file | 86 | void Om3u::readPls() { //it's a pls file |
86 | QTextStream t( &f ); | 87 | QTextStream t( &f ); |
87 | QString s; | 88 | t.setEncoding(QTextStream::UnicodeUTF8); |
89 | QString s; | ||
88 | while ( !t.atEnd() ) { | 90 | while ( !t.atEnd() ) { |
89 | s = t.readLine(); | 91 | s = t.readLine(); |
90 | if( s.left(4) == "File" ) { | 92 | if( s.left(4) == "File" ) { |
@@ -121,12 +123,13 @@ void Om3u::readPls() { //it's a pls file | |||
121 | 123 | ||
122 | void Om3u::write() { //writes list to m3u file | 124 | void Om3u::write() { //writes list to m3u file |
123 | QString list; | 125 | QString list; |
124 | if(count()>0) { | 126 | QTextStream t(&f); |
127 | t.setEncoding(QTextStream::UnicodeUTF8); | ||
128 | if(count()>0) { | ||
125 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 129 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
126 | // qDebug(*it); | 130 | // qDebug(*it); |
127 | list += *it+"\n"; | 131 | t << *it << "\n"; |
128 | } | 132 | } |
129 | f.writeBlock( list, list.length() ); | ||
130 | } | 133 | } |
131 | // f.close(); | 134 | // f.close(); |
132 | } | 135 | } |