author | llornkcor <llornkcor> | 2002-08-16 00:48:49 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-08-16 00:48:49 (UTC) |
commit | f25db7780ff234b2770ac13d8c02887b79a57a26 (patch) (side-by-side diff) | |
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 @@ -488,24 +488,26 @@ void PlayListWidget::setDocument(const QString& fileref) { addToSelection( DocLnk( fileref ) ); d->setDocumentUsed = TRUE; mediaPlayerState->setPlaying( FALSE ); qApp->processEvents(); mediaPlayerState->setPlaying( TRUE ); qApp->processEvents(); setCaption(tr("OpiePlayer")); } } void PlayListWidget::setActiveWindow() { + qDebug("SETTING active window"); + // When we get raised we need to ensure that it switches views char origView = mediaPlayerState->view(); mediaPlayerState->setView( 'l' ); // invalidate mediaPlayerState->setView( origView ); // now switch back } void PlayListWidget::useSelectedDocument() { d->setDocumentUsed = FALSE; } @@ -947,33 +949,29 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const void PlayListWidget::listDelete() { Config cfg( "OpiePlayer" ); cfg.setGroup("PlayList"); QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); QString file; int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); switch ( tabWidget->currentPageIndex()) { case 0: break; case 1: { - file = audioView->selectedItem()->text(0); -// Global::findDocuments(&files, "audio/*"); -// AppLnkSet appFiles; - QListIterator<DocLnk> dit( files.children() ); - for ( ; dit.current(); ++dit ) { - if( dit.current()->name() == file) { -// qDebug(file); - LnkProperties prop( dit.current() ); -// connect(&prop, SIGNAL(select(const AppLnk *)), this, SLOT(externalSelected(const AppLnk *))); + file = audioView->currentItem()->text(0); + QListIterator<DocLnk> Pdit( files.children() ); + for ( ; Pdit.current(); ++Pdit ) { + if( Pdit.current()->name() == file) { + LnkProperties prop( Pdit.current() ); prop.showMaximized(); prop.exec(); } } populateAudioView(); } break; case 2: { // file = videoView->selectedItem()->text(0); // for ( int i = 0; i < noOfFiles; i++ ) { // QString entryName; @@ -1070,52 +1068,47 @@ void PlayListWidget::populateVideoView() { } void PlayListWidget::openFile() { QString filename, name; InputDialog *fileDlg; fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); fileDlg->exec(); if( fileDlg->result() == 1 ) { filename = fileDlg->LineEdit1->text(); // http://205.188.234.129:8030 // http://66.28.68.70:8000 // filename.replace(QRegExp("%20")," "); - if(filename.find(" ",0,TRUE) != -1 || filename.find("%20",0,TRUE) != -1) { - QMessageBox::message("Note","Spaces in urls are not allowed."); - return; - } else { qDebug("Selected filename is "+filename); if(filename.right(3) == "m3u") readm3u( filename); else if(filename.right(3) == "pls") readPls( filename); else { DocLnk lnk; lnk.setName(filename); //sets file name if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") filename += "/"; lnk.setFile(filename); //sets File property lnk.setType("audio/x-mpegurl"); lnk.setExec("opieplayer"); lnk.setIcon("opieplayer/MPEGPlayer"); if(!lnk.writeLink()) qDebug("Writing doclink did not work"); d->selectedFiles->addToSelection( lnk); // if(fileDlg2) // delete fileDlg2; } - } } if(fileDlg) delete fileDlg; } void PlayListWidget::keyReleaseEvent( QKeyEvent *e) { switch ( e->key() ) { ////////////////////////////// Zaurus keys case Key_F9: //activity // if(audioUI->isHidden()) // audioUI->showMaximized(); @@ -1221,28 +1214,26 @@ void PlayListWidget::doUnblank() { void PlayListWidget::readm3u(const QString &filename) { qDebug("m3u filename is "+filename); QFile f(filename); if(f.open(IO_ReadOnly)) { QTextStream t(&f); QString s;//, first, second; int i=0; while ( !t.atEnd()) { // Lview->insertLine(t.readLine(),-1); s=t.readLine(); - if(s.find(" ",0,TRUE) != -1 || s.find("%20",0,TRUE) != -1) { - QMessageBox::message("Note","Spaces in urls are not allowed."); - } - else if(s.find("#",0,TRUE) == -1) { + + if(s.find("#",0,TRUE) == -1) { if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat if(s.left(2) == "E:" || s.left(2) == "P:") { s=s.right(s.length()-2); DocLnk lnk( s ); QFileInfo f(s); QString name = f.baseName(); name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); lnk.setName( name); s=s.replace( QRegExp("\\"),"/"); lnk.setFile( s); lnk.writeLink(); // lnk.setIcon(opieplayer/MPEGPlayer); |