-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 60eb0c8..86130d5 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -489,80 +489,80 @@ void PlayListWidget::addSelected() { | |||
489 | 489 | ||
490 | } | 490 | } |
491 | break; | 491 | break; |
492 | }; | 492 | }; |
493 | } | 493 | } |
494 | 494 | ||
495 | 495 | ||
496 | void PlayListWidget::removeSelected() { | 496 | void PlayListWidget::removeSelected() { |
497 | d->selectedFiles->removeSelected( ); | 497 | d->selectedFiles->removeSelected( ); |
498 | writeCurrentM3u(); | 498 | writeCurrentM3u(); |
499 | } | 499 | } |
500 | 500 | ||
501 | 501 | ||
502 | void PlayListWidget::playIt( QListViewItem *it) { | 502 | void PlayListWidget::playIt( QListViewItem *it) { |
503 | if(!it) return; | 503 | if(!it) return; |
504 | mediaPlayerState->setPlaying(FALSE); | 504 | mediaPlayerState->setPlaying(FALSE); |
505 | mediaPlayerState->setPlaying(TRUE); | 505 | mediaPlayerState->setPlaying(TRUE); |
506 | d->selectedFiles->unSelect(); | 506 | d->selectedFiles->unSelect(); |
507 | } | 507 | } |
508 | 508 | ||
509 | 509 | ||
510 | void PlayListWidget::addToSelection( QListViewItem *it) { | 510 | void PlayListWidget::addToSelection( QListViewItem *it) { |
511 | d->setDocumentUsed = FALSE; | 511 | d->setDocumentUsed = FALSE; |
512 | 512 | ||
513 | if(it) { | 513 | if(it) { |
514 | switch ( whichList()) { | 514 | switch ( whichList()) { |
515 | case 1: { | 515 | case 1: { |
516 | QListIterator<DocLnk> dit( files.children() ); | 516 | QListIterator<DocLnk> dit( files.children() ); |
517 | for ( ; dit.current(); ++dit ) { | 517 | for ( ; dit.current(); ++dit ) { |
518 | if( dit.current()->name() == it->text(0)) { | 518 | if( dit.current()->name() == it->text(0)) { |
519 | if(QFileInfo( dit.current()->file()).exists()) { | 519 | if(QFileInfo( dit.current()->file()).exists()) { |
520 | d->selectedFiles->addToSelection( **dit ); | 520 | d->selectedFiles->addToSelection( **dit ); |
521 | qDebug("blah "+ dit.current()->name()); | 521 | // qDebug("blah "+ dit.current()->name()); |
522 | d->selectedFiles->setSelectedItem( dit.current()->name()); | 522 | // d->selectedFiles->setSelectedItem( dit.current()->name()); |
523 | } | 523 | } |
524 | } | 524 | } |
525 | } | 525 | } |
526 | writeCurrentM3u(); | 526 | writeCurrentM3u(); |
527 | } | 527 | } |
528 | break; | 528 | break; |
529 | case 2: { | 529 | case 2: { |
530 | QListIterator<DocLnk> dit( vFiles.children() ); | 530 | QListIterator<DocLnk> dit( vFiles.children() ); |
531 | for ( ; dit.current(); ++dit ) { | 531 | for ( ; dit.current(); ++dit ) { |
532 | if( dit.current()->name() == it->text(0)) { | 532 | if( dit.current()->name() == it->text(0)) { |
533 | if( QFileInfo( dit.current()->file()).exists() ) { | 533 | if( QFileInfo( dit.current()->file()).exists() ) { |
534 | d->selectedFiles->addToSelection( **dit ); | 534 | d->selectedFiles->addToSelection( **dit ); |
535 | qDebug("blah "+ dit.current()->name()); | 535 | // qDebug("blah "+ dit.current()->name()); |
536 | d->selectedFiles->setSelectedItem( dit.current()->name()); | 536 | // d->selectedFiles->setSelectedItem( dit.current()->name()); |
537 | } | 537 | } |
538 | } | 538 | } |
539 | } | 539 | } |
540 | writeCurrentM3u(); | 540 | writeCurrentM3u(); |
541 | 541 | ||
542 | } | 542 | } |
543 | break; | 543 | break; |
544 | case 0: | 544 | case 0: |
545 | break; | 545 | break; |
546 | }; | 546 | }; |
547 | tabWidget->setCurrentPage(0); | 547 | tabWidget->setCurrentPage(0); |
548 | 548 | ||
549 | } | 549 | } |
550 | } | 550 | } |
551 | 551 | ||
552 | 552 | ||
553 | void PlayListWidget::tabChanged(QWidget *) { | 553 | void PlayListWidget::tabChanged(QWidget *) { |
554 | 554 | ||
555 | switch ( whichList()) { | 555 | switch ( whichList()) { |
556 | case 0: | 556 | case 0: |
557 | { | 557 | { |
558 | if( !tbDeletePlaylist->isHidden() ) { | 558 | if( !tbDeletePlaylist->isHidden() ) { |
559 | tbDeletePlaylist->hide(); | 559 | tbDeletePlaylist->hide(); |
560 | } | 560 | } |
561 | d->tbRemoveFromList->setEnabled(TRUE); | 561 | d->tbRemoveFromList->setEnabled(TRUE); |
562 | d->tbAddToList->setEnabled(FALSE); | 562 | d->tbAddToList->setEnabled(FALSE); |
563 | } | 563 | } |
564 | break; | 564 | break; |
565 | case 1: | 565 | case 1: |
566 | { | 566 | { |
567 | audioView->clear(); | 567 | audioView->clear(); |
568 | populateAudioView(); | 568 | populateAudioView(); |
@@ -723,65 +723,65 @@ void PlayListWidget::openFile() { | |||
723 | QString filename, name; | 723 | QString filename, name; |
724 | InputDialog *fileDlg; | 724 | InputDialog *fileDlg; |
725 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 725 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
726 | fileDlg->exec(); | 726 | fileDlg->exec(); |
727 | if( fileDlg->result() == 1 ) { | 727 | if( fileDlg->result() == 1 ) { |
728 | filename = fileDlg->text(); | 728 | filename = fileDlg->text(); |
729 | qDebug( "Selected filename is " + filename ); | 729 | qDebug( "Selected filename is " + filename ); |
730 | Om3u *m3uList; | 730 | Om3u *m3uList; |
731 | DocLnk lnk; | 731 | DocLnk lnk; |
732 | Config cfg( "OpiePlayer" ); | 732 | Config cfg( "OpiePlayer" ); |
733 | cfg.setGroup("PlayList"); | 733 | cfg.setGroup("PlayList"); |
734 | 734 | ||
735 | if(filename.left(4) == "http") { | 735 | if(filename.left(4) == "http") { |
736 | QString m3uFile, m3uFilePath; | 736 | QString m3uFile, m3uFilePath; |
737 | if(filename.find(":",8,TRUE) != -1) { //found a port | 737 | if(filename.find(":",8,TRUE) != -1) { //found a port |
738 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | 738 | m3uFile = filename.left( filename.find( ":",8,TRUE)); |
739 | m3uFile = m3uFile.right( 7); | 739 | m3uFile = m3uFile.right( 7); |
740 | } else if(filename.left(4) == "http"){ | 740 | } else if(filename.left(4) == "http"){ |
741 | m3uFile=filename; | 741 | m3uFile=filename; |
742 | m3uFile = m3uFile.right( m3uFile.length() - 7); | 742 | m3uFile = m3uFile.right( m3uFile.length() - 7); |
743 | } else{ | 743 | } else{ |
744 | m3uFile=filename; | 744 | m3uFile=filename; |
745 | } | 745 | } |
746 | 746 | ||
747 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); | 747 | // qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); |
748 | lnk.setName( filename ); //sets name | 748 | lnk.setName( filename ); //sets name |
749 | lnk.setFile( filename ); //sets file name | 749 | lnk.setFile( filename ); //sets file name |
750 | 750 | ||
751 | // lnk.setIcon("opieplayer2/musicfile"); | 751 | // lnk.setIcon("opieplayer2/musicfile"); |
752 | 752 | ||
753 | d->selectedFiles->addToSelection( lnk ); | 753 | d->selectedFiles->addToSelection( lnk ); |
754 | writeCurrentM3u(); | 754 | writeCurrentM3u(); |
755 | d->selectedFiles->setSelectedItem( lnk->name()); | 755 | d->selectedFiles->setSelectedItem( lnk.name()); |
756 | } | 756 | } |
757 | else if( filename.right( 3) == "m3u" ) { | 757 | else if( filename.right( 3) == "m3u" ) { |
758 | readm3u( filename ); | 758 | readm3u( filename ); |
759 | 759 | ||
760 | } else if( filename.right(3) == "pls" ) { | 760 | } else if( filename.right(3) == "pls" ) { |
761 | readPls( filename ); | 761 | readPls( filename ); |
762 | } else { | 762 | } else { |
763 | lnk.setName( QFileInfo(filename).baseName() ); //sets name | 763 | lnk.setName( QFileInfo(filename).baseName() ); //sets name |
764 | lnk.setFile( filename ); //sets file name | 764 | lnk.setFile( filename ); //sets file name |
765 | d->selectedFiles->addToSelection( lnk); | 765 | d->selectedFiles->addToSelection( lnk); |
766 | writeCurrentM3u(); | 766 | writeCurrentM3u(); |
767 | d->selectedFiles->setSelectedItem( lnk.name()); | 767 | d->selectedFiles->setSelectedItem( lnk.name()); |
768 | } | 768 | } |
769 | } | 769 | } |
770 | 770 | ||
771 | if( fileDlg ) { | 771 | if( fileDlg ) { |
772 | delete fileDlg; | 772 | delete fileDlg; |
773 | } | 773 | } |
774 | } | 774 | } |
775 | 775 | ||
776 | /* | 776 | /* |
777 | reads m3u and shows files/urls to playlist widget */ | 777 | reads m3u and shows files/urls to playlist widget */ |
778 | void PlayListWidget::readm3u( const QString &filename ) { | 778 | void PlayListWidget::readm3u( const QString &filename ) { |
779 | qDebug( "read m3u filename " + filename ); | 779 | qDebug( "read m3u filename " + filename ); |
780 | 780 | ||
781 | Om3u *m3uList; | 781 | Om3u *m3uList; |
782 | QString s, name; | 782 | QString s, name; |
783 | m3uList = new Om3u( filename, IO_ReadOnly ); | 783 | m3uList = new Om3u( filename, IO_ReadOnly ); |
784 | m3uList->readM3u(); | 784 | m3uList->readM3u(); |
785 | DocLnk lnk; | 785 | DocLnk lnk; |
786 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { | 786 | for ( QStringList::ConstIterator it = m3uList->begin(); it != m3uList->end(); ++it ) { |
787 | s = *it; | 787 | s = *it; |