author | llornkcor <llornkcor> | 2002-08-16 00:48:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-16 00:48:49 (UTC) |
commit | f25db7780ff234b2770ac13d8c02887b79a57a26 (patch) (unidiff) | |
tree | 534b91999f3f713ee4869bd53ffbc45840338d96 | |
parent | 47e3b3c20e17b257fb2d3d56bace2a89a8f0d28b (diff) | |
download | opie-f25db7780ff234b2770ac13d8c02887b79a57a26.zip opie-f25db7780ff234b2770ac13d8c02887b79a57a26.tar.gz opie-f25db7780ff234b2770ac13d8c02887b79a57a26.tar.bz2 |
spaces thing crept back in I think
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 26103c3..65dc5fb 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -492,16 +492,18 @@ void PlayListWidget::setDocument(const QString& fileref) { | |||
492 | mediaPlayerState->setPlaying( TRUE ); | 492 | mediaPlayerState->setPlaying( TRUE ); |
493 | qApp->processEvents(); | 493 | qApp->processEvents(); |
494 | setCaption(tr("OpiePlayer")); | 494 | setCaption(tr("OpiePlayer")); |
495 | } | 495 | } |
496 | } | 496 | } |
497 | 497 | ||
498 | 498 | ||
499 | void PlayListWidget::setActiveWindow() { | 499 | void PlayListWidget::setActiveWindow() { |
500 | qDebug("SETTING active window"); | ||
501 | |||
500 | // When we get raised we need to ensure that it switches views | 502 | // When we get raised we need to ensure that it switches views |
501 | char origView = mediaPlayerState->view(); | 503 | char origView = mediaPlayerState->view(); |
502 | mediaPlayerState->setView( 'l' ); // invalidate | 504 | mediaPlayerState->setView( 'l' ); // invalidate |
503 | mediaPlayerState->setView( origView ); // now switch back | 505 | mediaPlayerState->setView( origView ); // now switch back |
504 | } | 506 | } |
505 | 507 | ||
506 | 508 | ||
507 | void PlayListWidget::useSelectedDocument() { | 509 | void PlayListWidget::useSelectedDocument() { |
@@ -951,25 +953,21 @@ void PlayListWidget::listDelete() { | |||
951 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 953 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
952 | QString file; | 954 | QString file; |
953 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 955 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
954 | switch ( tabWidget->currentPageIndex()) { | 956 | switch ( tabWidget->currentPageIndex()) { |
955 | case 0: | 957 | case 0: |
956 | break; | 958 | break; |
957 | case 1: | 959 | case 1: |
958 | { | 960 | { |
959 | file = audioView->selectedItem()->text(0); | 961 | file = audioView->currentItem()->text(0); |
960 | // Global::findDocuments(&files, "audio/*"); | 962 | QListIterator<DocLnk> Pdit( files.children() ); |
961 | // AppLnkSet appFiles; | 963 | for ( ; Pdit.current(); ++Pdit ) { |
962 | QListIterator<DocLnk> dit( files.children() ); | 964 | if( Pdit.current()->name() == file) { |
963 | for ( ; dit.current(); ++dit ) { | 965 | LnkProperties prop( Pdit.current() ); |
964 | if( dit.current()->name() == file) { | ||
965 | // qDebug(file); | ||
966 | LnkProperties prop( dit.current() ); | ||
967 | // connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); | ||
968 | prop.showMaximized(); | 966 | prop.showMaximized(); |
969 | prop.exec(); | 967 | prop.exec(); |
970 | } | 968 | } |
971 | } | 969 | } |
972 | populateAudioView(); | 970 | populateAudioView(); |
973 | } | 971 | } |
974 | break; | 972 | break; |
975 | case 2: | 973 | case 2: |
@@ -1074,20 +1072,16 @@ void PlayListWidget::openFile() { | |||
1074 | InputDialog *fileDlg; | 1072 | InputDialog *fileDlg; |
1075 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1073 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1076 | fileDlg->exec(); | 1074 | fileDlg->exec(); |
1077 | if( fileDlg->result() == 1 ) { | 1075 | if( fileDlg->result() == 1 ) { |
1078 | filename = fileDlg->LineEdit1->text(); | 1076 | filename = fileDlg->LineEdit1->text(); |
1079 | // http://205.188.234.129:8030 | 1077 | // http://205.188.234.129:8030 |
1080 | // http://66.28.68.70:8000 | 1078 | // http://66.28.68.70:8000 |
1081 | // filename.replace(QRegExp("%20")," "); | 1079 | // filename.replace(QRegExp("%20")," "); |
1082 | if(filename.find(" ",0,TRUE) != -1 || filename.find("%20",0,TRUE) != -1) { | ||
1083 | QMessageBox::message("Note","Spaces in urls are not allowed."); | ||
1084 | return; | ||
1085 | } else { | ||
1086 | qDebug("Selected filename is "+filename); | 1080 | qDebug("Selected filename is "+filename); |
1087 | if(filename.right(3) == "m3u") | 1081 | if(filename.right(3) == "m3u") |
1088 | readm3u( filename); | 1082 | readm3u( filename); |
1089 | else if(filename.right(3) == "pls") | 1083 | else if(filename.right(3) == "pls") |
1090 | readPls( filename); | 1084 | readPls( filename); |
1091 | else { | 1085 | else { |
1092 | DocLnk lnk; | 1086 | DocLnk lnk; |
1093 | 1087 | ||
@@ -1101,17 +1095,16 @@ void PlayListWidget::openFile() { | |||
1101 | lnk.setIcon("opieplayer/MPEGPlayer"); | 1095 | lnk.setIcon("opieplayer/MPEGPlayer"); |
1102 | 1096 | ||
1103 | if(!lnk.writeLink()) | 1097 | if(!lnk.writeLink()) |
1104 | qDebug("Writing doclink did not work"); | 1098 | qDebug("Writing doclink did not work"); |
1105 | d->selectedFiles->addToSelection( lnk); | 1099 | d->selectedFiles->addToSelection( lnk); |
1106 | // if(fileDlg2) | 1100 | // if(fileDlg2) |
1107 | // delete fileDlg2; | 1101 | // delete fileDlg2; |
1108 | } | 1102 | } |
1109 | } | ||
1110 | } | 1103 | } |
1111 | if(fileDlg) | 1104 | if(fileDlg) |
1112 | delete fileDlg; | 1105 | delete fileDlg; |
1113 | } | 1106 | } |
1114 | 1107 | ||
1115 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 1108 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
1116 | { | 1109 | { |
1117 | switch ( e->key() ) { | 1110 | switch ( e->key() ) { |
@@ -1225,20 +1218,18 @@ void PlayListWidget::readm3u(const QString &filename) { | |||
1225 | 1218 | ||
1226 | if(f.open(IO_ReadOnly)) { | 1219 | if(f.open(IO_ReadOnly)) { |
1227 | QTextStream t(&f); | 1220 | QTextStream t(&f); |
1228 | QString s;//, first, second; | 1221 | QString s;//, first, second; |
1229 | int i=0; | 1222 | int i=0; |
1230 | while ( !t.atEnd()) { | 1223 | while ( !t.atEnd()) { |
1231 | // Lview->insertLine(t.readLine(),-1); | 1224 | // Lview->insertLine(t.readLine(),-1); |
1232 | s=t.readLine(); | 1225 | s=t.readLine(); |
1233 | if(s.find(" ",0,TRUE) != -1 || s.find("%20",0,TRUE) != -1) { | 1226 | |
1234 | QMessageBox::message("Note","Spaces in urls are not allowed."); | 1227 | if(s.find("#",0,TRUE) == -1) { |
1235 | } | ||
1236 | else if(s.find("#",0,TRUE) == -1) { | ||
1237 | if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat | 1228 | if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat |
1238 | if(s.left(2) == "E:" || s.left(2) == "P:") { | 1229 | if(s.left(2) == "E:" || s.left(2) == "P:") { |
1239 | s=s.right(s.length()-2); | 1230 | s=s.right(s.length()-2); |
1240 | DocLnk lnk( s ); | 1231 | DocLnk lnk( s ); |
1241 | QFileInfo f(s); | 1232 | QFileInfo f(s); |
1242 | QString name = f.baseName(); | 1233 | QString name = f.baseName(); |
1243 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1234 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1244 | lnk.setName( name); | 1235 | lnk.setName( name); |