summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/om3u.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/om3u.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/om3u.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/om3u.cpp b/noncore/multimedia/opieplayer2/om3u.cpp
index 235d973..841d950 100644
--- a/noncore/multimedia/opieplayer2/om3u.cpp
+++ b/noncore/multimedia/opieplayer2/om3u.cpp
@@ -73,49 +73,50 @@ void Om3u::readM3u() {
73 s=s.replace( QRegExp( "\\" ), "/" ); 73 s=s.replace( QRegExp( "\\" ), "/" );
74 append(s); 74 append(s);
75// qDebug(s); 75// qDebug(s);
76 } else { // is url 76 } else { // is url
77 s.replace( QRegExp( "%20" )," " ); 77 s.replace( QRegExp( "%20" )," " );
78 QString name; 78 QString name;
79// if( name.left( 4 ) == "http" ) { 79// if( name.left( 4 ) == "http" ) {
80// name = s.right( s.length() - 7 ); 80// name = s.right( s.length() - 7 );
81// } else { 81// } else {
82 name = s; 82 name = s;
83// } 83// }
84 append(name); 84 append(name);
85// qDebug(name); 85// qDebug(name);
86 } 86 }
87 } 87 }
88 } 88 }
89} 89}
90 90
91void Om3u::readPls() { //it's a pls file 91void Om3u::readPls() { //it's a pls file
92 QTextStream t( &f ); 92 QTextStream t( &f );
93 QString s; 93 QString s;
94 while ( !t.atEnd() ) { 94 while ( !t.atEnd() ) {
95 s = t.readLine(); 95 s = t.readLine();
96 if( s.left(4) == "File" ) { 96 if( s.left(4) == "File" ) {
97 s = s.right( s.length() - 6 ); 97 s = s.right( s.length() - s.find("=",0,true)-1 );
98 s = s.stripWhiteSpace();
98 s.replace( QRegExp( "%20" )," "); 99 s.replace( QRegExp( "%20" )," ");
99// qDebug( "adding " + s + " to playlist" ); 100// qDebug( "adding " + s + " to playlist" );
100 // numberofentries=2 101 // numberofentries=2
101 // File1=http 102 // File1=http
102 // Title 103 // Title
103 // Length 104 // Length
104 // Version 105 // Version
105 // File2=http 106 // File2=http
106 s = s.replace( QRegExp( "\\" ), "/" ); 107 s = s.replace( QRegExp( "\\" ), "/" );
107 QFileInfo f( s ); 108 QFileInfo f( s );
108 QString name = f.baseName(); 109 QString name = f.baseName();
109 if( name.left( 4 ) == "http" ) { 110 if( name.left( 4 ) == "http" ) {
110 name = s.right( s.length() - 7); 111 name = s.right( s.length() - 7);
111 } else { 112 } else {
112 name = s; 113 name = s;
113 } 114 }
114 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 ); 115 name = name.right( name.length() - name.findRev( "\\", -1, TRUE) - 1 );
115 if( s.at( s.length() - 4) == '.') // if this is probably a file 116 if( s.at( s.length() - 4) == '.') // if this is probably a file
116 append(s); 117 append(s);
117 else { //if its a url 118 else { //if its a url
118// if( name.right( 1 ).find( '/' ) == -1) { 119// if( name.right( 1 ).find( '/' ) == -1) {
119// s += "/"; 120// s += "/";
120// } 121// }
121 append(s); 122 append(s);