-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index e9615f1..580460e 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -696,97 +696,97 @@ void PlayListWidget::readListFromFile( const QString &filename ) { | |||
696 | 696 | ||
697 | // writes current playlist to current m3u file */ | 697 | // writes current playlist to current m3u file */ |
698 | void PlayListWidget::writeCurrentM3u() { | 698 | void PlayListWidget::writeCurrentM3u() { |
699 | qDebug("writing to current m3u"); | 699 | qDebug("writing to current m3u"); |
700 | Config cfg( "OpiePlayer" ); | 700 | Config cfg( "OpiePlayer" ); |
701 | cfg.setGroup("PlayList"); | 701 | cfg.setGroup("PlayList"); |
702 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); | 702 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
703 | 703 | ||
704 | Om3u *m3uList; | 704 | Om3u *m3uList; |
705 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 705 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
706 | if( d->selectedFiles->first()) { | 706 | if( d->selectedFiles->first()) { |
707 | 707 | ||
708 | do { | 708 | do { |
709 | // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); | 709 | // qDebug( "add writeCurrentM3u " +d->selectedFiles->current()->file()); |
710 | m3uList->add( d->selectedFiles->current()->file() ); | 710 | m3uList->add( d->selectedFiles->current()->file() ); |
711 | } | 711 | } |
712 | while ( d->selectedFiles->next() ); | 712 | while ( d->selectedFiles->next() ); |
713 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 713 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
714 | m3uList->write(); | 714 | m3uList->write(); |
715 | m3uList->close(); | 715 | m3uList->close(); |
716 | } | 716 | } |
717 | delete m3uList; | 717 | delete m3uList; |
718 | 718 | ||
719 | } | 719 | } |
720 | 720 | ||
721 | /* | 721 | /* |
722 | writes current playlist to m3u file */ | 722 | writes current playlist to m3u file */ |
723 | void PlayListWidget::writem3u() { | 723 | void PlayListWidget::writem3u() { |
724 | InputDialog *fileDlg; | 724 | InputDialog *fileDlg; |
725 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); | 725 | fileDlg = new InputDialog( this, tr( "Save m3u Playlist " ), TRUE, 0); |
726 | fileDlg->exec(); | 726 | fileDlg->exec(); |
727 | QString name, filename, list; | 727 | QString name, filename, list; |
728 | Om3u *m3uList; | 728 | Om3u *m3uList; |
729 | 729 | ||
730 | if( fileDlg->result() == 1 ) { | 730 | if( fileDlg->result() == 1 ) { |
731 | name = fileDlg->text(); | 731 | name = fileDlg->text(); |
732 | // qDebug( filename ); | 732 | // qDebug( filename ); |
733 | if( name.find("/",0,true) != -1) {// assume they specify a file path | 733 | if( name.find("/",0,true) != -1) {// assume they specify a file path |
734 | filename = name; | 734 | filename = name; |
735 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); | 735 | name = name.right(name.length()- name.findRev("/",-1,true) - 1 ); |
736 | } | 736 | } |
737 | else //otherwise dump it somewhere noticable | 737 | else //otherwise dump it somewhere noticable |
738 | filename = QPEApplication::documentDir() + "/" + name; | 738 | filename = QPEApplication::documentDir() + "/" + name; |
739 | 739 | ||
740 | if( filename.right( 3 ) != "m3u" ) //needs filename extension | 740 | if( filename.right( 3 ) != "m3u" ) //needs filename extension |
741 | filename += ".m3u"; | 741 | filename += ".m3u"; |
742 | 742 | ||
743 | if( d->selectedFiles->first()) { //ramble through playlist view | 743 | if( d->selectedFiles->first()) { //ramble through playlist view |
744 | m3uList = new Om3u( filename, IO_ReadWrite); | 744 | m3uList = new Om3u( filename, IO_ReadWrite | IO_Truncate); |
745 | 745 | ||
746 | do { | 746 | do { |
747 | m3uList->add( d->selectedFiles->current()->file()); | 747 | m3uList->add( d->selectedFiles->current()->file()); |
748 | } | 748 | } |
749 | while ( d->selectedFiles->next() ); | 749 | while ( d->selectedFiles->next() ); |
750 | // qDebug( list ); | 750 | // qDebug( list ); |
751 | m3uList->write(); | 751 | m3uList->write(); |
752 | m3uList->close(); | 752 | m3uList->close(); |
753 | delete m3uList; | 753 | delete m3uList; |
754 | 754 | ||
755 | delete fileDlg; | 755 | delete fileDlg; |
756 | 756 | ||
757 | DocLnk lnk; | 757 | DocLnk lnk; |
758 | lnk.setFile( filename); | 758 | lnk.setFile( filename); |
759 | lnk.setIcon("opieplayer2/playlist2"); | 759 | lnk.setIcon("opieplayer2/playlist2"); |
760 | lnk.setName( name); //sets file name | 760 | lnk.setName( name); //sets file name |
761 | 761 | ||
762 | // qDebug(filename); | 762 | // qDebug(filename); |
763 | Config config( "OpiePlayer" ); | 763 | Config config( "OpiePlayer" ); |
764 | config.setGroup( "PlayList" ); | 764 | config.setGroup( "PlayList" ); |
765 | 765 | ||
766 | config.writeEntry("CurrentPlaylist",filename); | 766 | config.writeEntry("CurrentPlaylist",filename); |
767 | currentPlayList=filename; | 767 | currentPlayList=filename; |
768 | 768 | ||
769 | if(!lnk.writeLink()) { | 769 | if(!lnk.writeLink()) { |
770 | qDebug("Writing doclink did not work"); | 770 | qDebug("Writing doclink did not work"); |
771 | } | 771 | } |
772 | 772 | ||
773 | setCaption(tr("OpiePlayer: ") + name); | 773 | setCaption(tr("OpiePlayer: ") + name); |
774 | } | 774 | } |
775 | } | 775 | } |
776 | } | 776 | } |
777 | 777 | ||
778 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { | 778 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e ) { |
779 | switch ( e->key() ) { | 779 | switch ( e->key() ) { |
780 | ////////////////////////////// Zaurus keys | 780 | ////////////////////////////// Zaurus keys |
781 | case Key_F9: //activity | 781 | case Key_F9: //activity |
782 | // if(audioUI->isHidden()) | 782 | // if(audioUI->isHidden()) |
783 | // audioUI->showMaximized(); | 783 | // audioUI->showMaximized(); |
784 | break; | 784 | break; |
785 | case Key_F10: //contacts | 785 | case Key_F10: //contacts |
786 | // if( videoUI->isHidden()) | 786 | // if( videoUI->isHidden()) |
787 | // videoUI->showMaximized(); | 787 | // videoUI->showMaximized(); |
788 | break; | 788 | break; |
789 | case Key_F11: //menu | 789 | case Key_F11: //menu |
790 | break; | 790 | break; |
791 | case Key_F12: //home | 791 | case Key_F12: //home |
792 | // doBlank(); | 792 | // doBlank(); |