-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 299181b..8b295b0 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1060,20 +1060,27 @@ void PlayListWidget::openFile() { | |||
1060 | Config cfg( "OpiePlayer" ); | 1060 | Config cfg( "OpiePlayer" ); |
1061 | cfg.setGroup("PlayList"); | 1061 | cfg.setGroup("PlayList"); |
1062 | 1062 | ||
1063 | QString m3uFile; | ||
1064 | m3uFile = filename; | ||
1063 | if(filename.left(4) == "http") { | 1065 | if(filename.left(4) == "http") { |
1064 | QString m3uFile, m3uFilePath; | ||
1065 | if(filename.find(":",8,TRUE) != -1) { //found a port | 1066 | if(filename.find(":",8,TRUE) != -1) { //found a port |
1066 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | ||
1067 | m3uFile = m3uFile.right( 7); | ||
1068 | } else if(filename.left(4) == "http"){ | ||
1069 | m3uFile=filename; | ||
1070 | m3uFile = m3uFile.right( m3uFile.length() - 7); | ||
1071 | } else{ | ||
1072 | m3uFile=filename; | ||
1073 | } | ||
1074 | 1067 | ||
1075 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); | 1068 | // m3uFile = filename.left( filename.find( ":",8,TRUE)); |
1076 | lnk.setName( filename ); //sets name | 1069 | m3uFile = filename; |
1070 | if( m3uFile.right( 1 ).find( '/' ) == -1) { | ||
1071 | m3uFile += "/"; | ||
1072 | } | ||
1073 | filename = m3uFile; | ||
1074 | // qDebug("1 "+m3uFile); | ||
1075 | // } else if(filename.left(4) == "http"){ | ||
1076 | // m3uFile=filename; | ||
1077 | // m3uFile = m3uFile.right( m3uFile.length() - 7); | ||
1078 | // qDebug("2 "+m3uFile); | ||
1079 | // } else{ | ||
1080 | // m3uFile=filename; | ||
1081 | // qDebug("3 "+m3uFile); | ||
1082 | } | ||
1083 | lnk.setName( m3uFile ); //sets name | ||
1077 | lnk.setFile( filename ); //sets file name | 1084 | lnk.setFile( filename ); //sets file name |
1078 | lnk.setIcon("opieplayer2/musicfile"); | 1085 | lnk.setIcon("opieplayer2/musicfile"); |
1079 | d->selectedFiles->addToSelection( lnk ); | 1086 | d->selectedFiles->addToSelection( lnk ); |
@@ -1114,7 +1121,10 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
1114 | if(s.left(4)=="http") { | 1121 | if(s.left(4)=="http") { |
1115 | lnk.setName( s ); //sets file name | 1122 | lnk.setName( s ); //sets file name |
1116 | lnk.setIcon("opieplayer2/musicfile"); | 1123 | lnk.setIcon("opieplayer2/musicfile"); |
1117 | if(s.right(4) != '.' || s.right(5) != '.') | 1124 | |
1125 | // if(s.right(4) != '.' || s.right(5) != '.') | ||
1126 | if(s.right(4) != '.' || s.right(5) != '.' ) | ||
1127 | if( s.right(1) != "/") | ||
1118 | lnk.setFile( s+"/"); //if url with no extension | 1128 | lnk.setFile( s+"/"); //if url with no extension |
1119 | else | 1129 | else |
1120 | lnk.setFile( s ); //sets file name | 1130 | lnk.setFile( s ); //sets file name |