Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/om3u.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp index 26d5e15..95dbab5 100644 --- a/noncore/multimedia/opieplayer2/om3u.cpp +++ b/noncore/multimedia/opieplayer2/om3u.cpp | |||
@@ -36,32 +36,32 @@ | |||
36 | //extern PlayListWidget *playList; | 36 | //extern PlayListWidget *playList; |
37 | 37 | ||
38 | Om3u::Om3u( const QString &filePath, int mode) | 38 | Om3u::Om3u( const QString &filePath, int mode) |
39 | : QStringList (){ | 39 | : QStringList (){ |
40 | qDebug("<<<<<<<new m3u "+filePath); | 40 | odebug << "<<<<<<<new m3u "+filePath << oendl; |
41 | f.setName(filePath); | 41 | f.setName(filePath); |
42 | f.open(mode); | 42 | f.open(mode); |
43 | } | 43 | } |
44 | 44 | ||
45 | Om3u::~Om3u(){} | 45 | Om3u::~Om3u(){} |
46 | 46 | ||
47 | void Om3u::readM3u() { | 47 | void Om3u::readM3u() { |
48 | // qDebug("<<<<<<reading m3u "+f.name()); | 48 | // odebug << "<<<<<<reading m3u "+f.name() << oendl; |
49 | QTextStream t(&f); | 49 | QTextStream t(&f); |
50 | t.setEncoding(QTextStream::UnicodeUTF8); | 50 | t.setEncoding(QTextStream::UnicodeUTF8); |
51 | QString s; | 51 | QString s; |
52 | while ( !t.atEnd() ) { | 52 | while ( !t.atEnd() ) { |
53 | s=t.readLine(); | 53 | s=t.readLine(); |
54 | // qDebug(s); | 54 | // odebug << s << oendl; |
55 | if( s.find( "#", 0, TRUE) == -1 ) { | 55 | if( s.find( "#", 0, TRUE) == -1 ) { |
56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { | 56 | if( s.left(2) == "E:" || s.left(2) == "P:" ) { |
57 | s = s.right( s.length() -2 ); | 57 | s = s.right( s.length() -2 ); |
58 | QFileInfo f( s ); | 58 | QFileInfo f( s ); |
59 | QString name = f.baseName(); | 59 | QString name = f.baseName(); |
60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); | 60 | name = name.right( name.length() - name.findRev( "\\", -1, TRUE ) -1 ); |
61 | s=s.replace( QRegExp( "\\" ), "/" ); | 61 | s=s.replace( QRegExp( "\\" ), "/" ); |
62 | append(s); | 62 | append(s); |
63 | // qDebug(s); | 63 | // odebug << s << oendl; |
64 | } else { // is url | 64 | } else { // is url |
65 | QString name; | 65 | QString name; |
66 | name = s; | 66 | name = s; |
67 | append(name); | 67 | append(name); |
@@ -79,9 +79,9 @@ void Om3u::readPls() { //it's a pls file | |||
79 | if( s.left(4) == "File" ) { | 79 | if( s.left(4) == "File" ) { |
80 | s = s.right( s.length() - s.find("=",0,true)-1 ); | 80 | s = s.right( s.length() - s.find("=",0,true)-1 ); |
81 | s = s.stripWhiteSpace(); | 81 | s = s.stripWhiteSpace(); |
82 | s.replace( QRegExp( "%20" )," "); | 82 | s.replace( QRegExp( "%20" )," "); |
83 | // qDebug( "adding " + s + " to playlist" ); | 83 | // odebug << "adding " + s + " to playlist" << oendl; |
84 | // numberofentries=2 | 84 | // numberofentries=2 |
85 | // File1=http | 85 | // File1=http |
86 | // Title | 86 | // Title |
87 | // Length | 87 | // Length |
@@ -113,9 +113,9 @@ void Om3u::write() { //writes list to m3u file | |||
113 | QTextStream t(&f); | 113 | QTextStream t(&f); |
114 | t.setEncoding(QTextStream::UnicodeUTF8); | 114 | t.setEncoding(QTextStream::UnicodeUTF8); |
115 | if(count()>0) { | 115 | if(count()>0) { |
116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 116 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
117 | // qDebug(*it); | 117 | // odebug << *it << oendl; |
118 | t << *it << "\n"; | 118 | t << *it << "\n"; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | // f.close(); | 121 | // f.close(); |
@@ -129,9 +129,9 @@ void Om3u::remove(const QString &filePath) { //removes from m3u list | |||
129 | QString list, currentFile; | 129 | QString list, currentFile; |
130 | if(count()>0) { | 130 | if(count()>0) { |
131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { | 131 | for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) { |
132 | currentFile=*it; | 132 | currentFile=*it; |
133 | // qDebug(*it); | 133 | // odebug << *it << oendl; |
134 | 134 | ||
135 | if( filePath != currentFile) | 135 | if( filePath != currentFile) |
136 | list += currentFile+"\n"; | 136 | list += currentFile+"\n"; |
137 | } | 137 | } |