author | llornkcor <llornkcor> | 2004-02-09 18:44:58 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2004-02-09 18:44:58 (UTC) |
commit | da2559d959567db6a1501e62aa9b2c7c693cc074 (patch) (unidiff) | |
tree | ccbacc2fbed3dab16b0da4c8d1524368d11e40f3 | |
parent | 31fb2e7e1ea652abefc82febbc5739198fa6aaa7 (diff) | |
download | opie-da2559d959567db6a1501e62aa9b2c7c693cc074.zip opie-da2559d959567db6a1501e62aa9b2c7c693cc074.tar.gz opie-da2559d959567db6a1501e62aa9b2c7c693cc074.tar.bz2 |
utf8 patch from Nikita V. Youshchenko <yoush@cs.msu.su>
-rw-r--r-- | core/multimedia/opieplayer/om3u.cpp | 7 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/lib.cpp | 2 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 13 |
3 files changed, 14 insertions, 8 deletions
diff --git a/core/multimedia/opieplayer/om3u.cpp b/core/multimedia/opieplayer/om3u.cpp index 8b92a8c..778eb22 100644 --- a/core/multimedia/opieplayer/om3u.cpp +++ b/core/multimedia/opieplayer/om3u.cpp | |||
@@ -66,8 +66,9 @@ 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 | t.setEncoding(QTextStream::UnicodeUTF8); | ||
70 | QString s; | 71 | QString s; |
71 | while ( !t.atEnd() ) { | 72 | while ( !t.atEnd() ) { |
72 | s=t.readLine(); | 73 | s=t.readLine(); |
73 | // qDebug(s); | 74 | // qDebug(s); |
@@ -96,8 +97,9 @@ void Om3u::readM3u() { | |||
96 | } | 97 | } |
97 | 98 | ||
98 | void Om3u::readPls() { //it's a pls file | 99 | void Om3u::readPls() { //it's a pls file |
99 | QTextStream t( &f ); | 100 | QTextStream t( &f ); |
101 | t.setEncoding(QTextStream::UnicodeUTF8); | ||
100 | QString s; | 102 | QString s; |
101 | while ( !t.atEnd() ) { | 103 | while ( !t.atEnd() ) { |
102 | s = t.readLine(); | 104 | s = t.readLine(); |
103 | if( s.left(4) == "File" ) { | 105 | if( s.left(4) == "File" ) { |
@@ -132,14 +134,15 @@ void Om3u::readPls() { //it's a pls file | |||
132 | } | 134 | } |
133 | 135 | ||
134 | void Om3u::write() { //writes list to m3u file | 136 | void Om3u::write() { //writes list to m3u file |
135 | QString list; | 137 | QString list; |
138 | QTextStream t(&f); | ||
139 | t.setEncoding(QTextStream::UnicodeUTF8); | ||
136 | if(count()>0) { | 140 | if(count()>0) { |
137 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 141 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
138 | // qDebug(*it); | 142 | // qDebug(*it); |
139 | list += *it+"\n"; | 143 | t << *it << "\n"; |
140 | } | 144 | } |
141 | f.writeBlock( list, list.length() ); | ||
142 | } | 145 | } |
143 | // f.close(); | 146 | // f.close(); |
144 | } | 147 | } |
145 | 148 | ||
diff --git a/noncore/multimedia/opieplayer2/lib.cpp b/noncore/multimedia/opieplayer2/lib.cpp index 00cfa33..664ec65 100644 --- a/noncore/multimedia/opieplayer2/lib.cpp +++ b/noncore/multimedia/opieplayer2/lib.cpp | |||
@@ -206,9 +206,9 @@ int Lib::play( const QString& fileName, int startPos, int start_time ) { | |||
206 | //m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); | 206 | //m_stream = xine_stream_new (m_xine, m_audioOutput, m_videoOutput ); |
207 | //m_queue = xine_event_new_queue (m_stream); | 207 | //m_queue = xine_event_new_queue (m_stream); |
208 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); | 208 | //xine_event_create_listener_thread (m_queue, xine_event_handler, this); |
209 | 209 | ||
210 | if ( !xine_open( m_stream, QFile::encodeName(str.utf8() ).data() ) ) { | 210 | if ( !xine_open( m_stream, str.utf8().data() ) ) { |
211 | return 0; | 211 | return 0; |
212 | } | 212 | } |
213 | return xine_play( m_stream, startPos, start_time); | 213 | return xine_play( m_stream, startPos, start_time); |
214 | } | 214 | } |
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 | |||
@@ -59,9 +59,10 @@ Om3u::~Om3u(){} | |||
59 | 59 | ||
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); |
67 | if( s.find( "#", 0, TRUE) == -1 ) { | 68 | if( s.find( "#", 0, TRUE) == -1 ) { |
@@ -83,9 +84,10 @@ void Om3u::readM3u() { | |||
83 | } | 84 | } |
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" ) { |
91 | s = s.right( s.length() - s.find("=",0,true)-1 ); | 93 | s = s.right( s.length() - s.find("=",0,true)-1 ); |
@@ -120,14 +122,15 @@ void Om3u::readPls() { //it's a pls file | |||
120 | } | 122 | } |
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 | } |
133 | 136 | ||