-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 79 |
1 files changed, 49 insertions, 30 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 41fcb30..2323ac2 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -418,9 +418,15 @@ void PlayListWidget::addToSelection( const DocLnk& lnk ) { | |||
418 | // qDebug("add"); | 418 | // qDebug("add"); |
419 | d->setDocumentUsed = FALSE; | 419 | if( lnk.file().find(" ",0,TRUE) != -1 || lnk.file().find("%20",0,TRUE) != -1) { |
420 | if ( mediaPlayerState->playlist() ) { | 420 | QMessageBox::message("Note","You are trying to play\na malformed url."); |
421 | if(QFileInfo(lnk.file()).exists() || lnk.file().left(4) == "http" ) | 421 | |
422 | d->selectedFiles->addToSelection( lnk ); | 422 | } else { |
423 | |||
424 | d->setDocumentUsed = FALSE; | ||
425 | if ( mediaPlayerState->playlist() ) { | ||
426 | if(QFileInfo(lnk.file()).exists() || lnk.file().left(4) == "http" ) | ||
427 | d->selectedFiles->addToSelection( lnk ); | ||
428 | } | ||
429 | else | ||
430 | mediaPlayerState->setPlaying( TRUE ); | ||
423 | } | 431 | } |
424 | else | ||
425 | mediaPlayerState->setPlaying( TRUE ); | ||
426 | } | 432 | } |
@@ -848,5 +854,10 @@ void PlayListWidget::btnPlay(bool b) { | |||
848 | { | 854 | { |
849 | 855 | qDebug("here we are"); | |
850 | mediaPlayerState->setPlaying(b); | 856 | if( d->selectedFiles->current()->file().find(" ",0,TRUE) != -1 || d->selectedFiles->current()->file().find("%20",0,TRUE) != -1) { |
851 | } | 857 | QMessageBox::message("Note","You are trying to play\na malformed url."); |
858 | |||
859 | } else { | ||
860 | |||
861 | mediaPlayerState->setPlaying(b); | ||
862 | } } | ||
852 | break; | 863 | break; |
@@ -854,10 +865,9 @@ void PlayListWidget::btnPlay(bool b) { | |||
854 | { | 865 | { |
855 | addToSelection( audioView->currentItem() ); | 866 | addToSelection( audioView->currentItem() ); |
856 | mediaPlayerState->setPlaying(b); | 867 | mediaPlayerState->setPlaying(b); |
857 | d->selectedFiles->removeSelected( ); | 868 | d->selectedFiles->removeSelected( ); |
858 | tabWidget->setCurrentPage(1); | 869 | tabWidget->setCurrentPage(1); |
859 | d->selectedFiles->unSelect(); | 870 | d->selectedFiles->unSelect(); |
860 | insanityBool=FALSE; | 871 | insanityBool=FALSE; |
861 | // audioView->clearSelection(); | 872 | }// audioView->clearSelection(); |
862 | } | ||
863 | break; | 873 | break; |
@@ -865,13 +875,13 @@ void PlayListWidget::btnPlay(bool b) { | |||
865 | { | 875 | { |
866 | addToSelection( videoView->currentItem() ); | 876 | addToSelection( videoView->currentItem() ); |
867 | mediaPlayerState->setPlaying(b); | 877 | mediaPlayerState->setPlaying(b); |
868 | qApp->processEvents(); | 878 | qApp->processEvents(); |
869 | d->selectedFiles->removeSelected( ); | 879 | d->selectedFiles->removeSelected( ); |
870 | tabWidget->setCurrentPage(2); | 880 | tabWidget->setCurrentPage(2); |
871 | d->selectedFiles->unSelect(); | 881 | d->selectedFiles->unSelect(); |
872 | insanityBool=FALSE; | 882 | insanityBool=FALSE; |
873 | // videoView->clearSelection(); | 883 | }// videoView->clearSelection(); |
874 | } | ||
875 | break; | 884 | break; |
876 | }; | 885 | }; |
886 | |||
877 | } | 887 | } |
@@ -1070,5 +1080,8 @@ void PlayListWidget::openFile() { | |||
1070 | // http://66.28.68.70:8000 | 1080 | // http://66.28.68.70:8000 |
1071 | filename.replace(QRegExp("%20")," "); | 1081 | // filename.replace(QRegExp("%20")," "); |
1072 | 1082 | if(filename.find(" ",0,TRUE) != -1 || filename.find("%20",0,TRUE) != -1) { | |
1073 | qDebug("Selected filename is "+filename); | 1083 | QMessageBox::message("Note","Spaces in urls are not allowed."); |
1084 | return; | ||
1085 | } else { | ||
1086 | qDebug("Selected filename is "+filename); | ||
1074 | if(filename.right(3) == "m3u") | 1087 | if(filename.right(3) == "m3u") |
@@ -1096,2 +1109,3 @@ void PlayListWidget::openFile() { | |||
1096 | } | 1109 | } |
1110 | } | ||
1097 | if(fileDlg) | 1111 | if(fileDlg) |
@@ -1207,3 +1221,6 @@ void PlayListWidget::readm3u(const QString &filename) { | |||
1207 | s=t.readLine(); | 1221 | s=t.readLine(); |
1208 | if(s.find("#",0,TRUE) == -1) { | 1222 | if(s.find(" ",0,TRUE) != -1 || s.find("%20",0,TRUE) != -1) { |
1223 | QMessageBox::message("Note","Spaces in urls are not allowed."); | ||
1224 | } | ||
1225 | else if(s.find("#",0,TRUE) == -1) { | ||
1209 | if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat | 1226 | if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat |
@@ -1222,2 +1239,3 @@ void PlayListWidget::readm3u(const QString &filename) { | |||
1222 | } else { // is url | 1239 | } else { // is url |
1240 | |||
1223 | s.replace(QRegExp("%20")," "); | 1241 | s.replace(QRegExp("%20")," "); |
@@ -1240,2 +1258,3 @@ void PlayListWidget::readm3u(const QString &filename) { | |||
1240 | } | 1258 | } |
1259 | f.close(); | ||
1241 | } | 1260 | } |