-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index d7447b7..200ec16 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1051,17 +1051,19 @@ void PlayListWidget::openFile() { | |||
1051 | QString filename, name; | 1051 | QString filename, name; |
1052 | InputDialog *fileDlg; | 1052 | InputDialog *fileDlg; |
1053 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1053 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1054 | fileDlg->exec(); | 1054 | fileDlg->exec(); |
1055 | if( fileDlg->result() == 1 ) { | 1055 | if( fileDlg->result() == 1 ) { |
1056 | filename = fileDlg->LineEdit1->text(); | 1056 | filename = fileDlg->LineEdit1->text(); |
1057 | // http://205.188.234.129:8030 | 1057 | // http://205.188.234.129:8030 |
1058 | // http://66.28.68.70:8000 | 1058 | // http://66.28.68.70:8000 |
1059 | qDebug("Selected filename is "+filename); | 1059 | filename.replace(QRegExp("%20")," "); |
1060 | |||
1061 | qDebug("Selected filename is "+filename); | ||
1060 | if(filename.right(3) == "m3u") | 1062 | if(filename.right(3) == "m3u") |
1061 | readm3u( filename); | 1063 | readm3u( filename); |
1062 | else if(filename.right(3) == "pls") | 1064 | else if(filename.right(3) == "pls") |
1063 | readPls( filename); | 1065 | readPls( filename); |
1064 | else { | 1066 | else { |
1065 | DocLnk lnk; | 1067 | DocLnk lnk; |
1066 | 1068 | ||
1067 | lnk.setName(filename); //sets file name | 1069 | lnk.setName(filename); //sets file name |
@@ -1201,16 +1203,17 @@ void PlayListWidget::readm3u(const QString &filename) { | |||
1201 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1203 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1202 | lnk.setName( name); | 1204 | lnk.setName( name); |
1203 | s=s.replace( QRegExp("\\"),"/"); | 1205 | s=s.replace( QRegExp("\\"),"/"); |
1204 | lnk.setFile( s); | 1206 | lnk.setFile( s); |
1205 | // lnk.setIcon(opieplayer/MPEGPlayer); | 1207 | // lnk.setIcon(opieplayer/MPEGPlayer); |
1206 | qDebug("add "+name); | 1208 | qDebug("add "+name); |
1207 | d->selectedFiles->addToSelection( lnk); | 1209 | d->selectedFiles->addToSelection( lnk); |
1208 | } else { // is url | 1210 | } else { // is url |
1211 | s.replace(QRegExp("%20")," "); | ||
1209 | DocLnk lnk( s); | 1212 | DocLnk lnk( s); |
1210 | QString name = s.right( s.length() - 7); | 1213 | QString name = s.right( s.length() - 7); |
1211 | // name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1214 | // name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1212 | lnk.setName(name); | 1215 | lnk.setName(name); |
1213 | lnk.setFile( s+"/"); | 1216 | lnk.setFile( s+"/"); |
1214 | // lnk.setFile( filename); | 1217 | // lnk.setFile( filename); |
1215 | // lnk.setComment( s+"/"); | 1218 | // lnk.setComment( s+"/"); |
1216 | lnk.setType("audio/x-mpegurl"); | 1219 | lnk.setType("audio/x-mpegurl"); |
@@ -1237,16 +1240,17 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1237 | if(f.open(IO_ReadOnly)) { | 1240 | if(f.open(IO_ReadOnly)) { |
1238 | QTextStream t(&f); | 1241 | QTextStream t(&f); |
1239 | QString s;//, first, second; | 1242 | QString s;//, first, second; |
1240 | int i=0; | 1243 | int i=0; |
1241 | while ( !t.atEnd()) { | 1244 | while ( !t.atEnd()) { |
1242 | s=t.readLine(); | 1245 | s=t.readLine(); |
1243 | if(s.left(4) == "File") { | 1246 | if(s.left(4) == "File") { |
1244 | s=s.right(s.length() - 6); | 1247 | s=s.right(s.length() - 6); |
1248 | s.replace(QRegExp("%20")," "); | ||
1245 | qDebug("adding "+s+" to playlist"); | 1249 | qDebug("adding "+s+" to playlist"); |
1246 | // numberofentries=2 | 1250 | // numberofentries=2 |
1247 | // File1=http | 1251 | // File1=http |
1248 | // Title | 1252 | // Title |
1249 | // Length | 1253 | // Length |
1250 | // Version | 1254 | // Version |
1251 | // File2=http | 1255 | // File2=http |
1252 | 1256 | ||