-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 7ada5ee..75c7332 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -696,32 +696,34 @@ void PlayListWidget::populateVideoView() { | |||
696 | pathName=path; | 696 | pathName=path; |
697 | } | 697 | } |
698 | } | 698 | } |
699 | 699 | ||
700 | QListViewItem * newItem; | 700 | QListViewItem * newItem; |
701 | if ( QFile( Vdit.current()->file() ).exists() ) { | 701 | if ( QFile( Vdit.current()->file() ).exists() ) { |
702 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), | 702 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), |
703 | QString::number( QFile( Vdit.current()->file() ).size() ), | 703 | QString::number( QFile( Vdit.current()->file() ).size() ), |
704 | storage, Vdit.current()->file()); | 704 | storage, Vdit.current()->file()); |
705 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); | 705 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer2/videofile" ) ); |
706 | } | 706 | } |
707 | } | 707 | } |
708 | } | 708 | } |
709 | 709 | ||
710 | 710 | ||
711 | void PlayListWidget::openFile() { | 711 | void PlayListWidget::openFile() { |
712 | // http://66.28.164.33:2080 | ||
713 | // http://somafm.com/star0242.m3u | ||
712 | QString filename, name; | 714 | QString filename, name; |
713 | InputDialog *fileDlg; | 715 | InputDialog *fileDlg; |
714 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 716 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
715 | fileDlg->exec(); | 717 | fileDlg->exec(); |
716 | if( fileDlg->result() == 1 ) { | 718 | if( fileDlg->result() == 1 ) { |
717 | filename = fileDlg->text(); | 719 | filename = fileDlg->text(); |
718 | qDebug( "Selected filename is " + filename ); | 720 | qDebug( "Selected filename is " + filename ); |
719 | Om3u *m3uList; | 721 | Om3u *m3uList; |
720 | DocLnk lnk; | 722 | DocLnk lnk; |
721 | Config cfg( "OpiePlayer" ); | 723 | Config cfg( "OpiePlayer" ); |
722 | cfg.setGroup("PlayList"); | 724 | cfg.setGroup("PlayList"); |
723 | 725 | ||
724 | if(filename.left(4) == "http") { | 726 | if(filename.left(4) == "http") { |
725 | QString m3uFile, m3uFilePath; | 727 | QString m3uFile, m3uFilePath; |
726 | if(filename.find(":",8,TRUE) != -1) { //found a port | 728 | if(filename.find(":",8,TRUE) != -1) { //found a port |
727 | m3uFile = filename.left( filename.find( ":",8,TRUE)); | 729 | m3uFile = filename.left( filename.find( ":",8,TRUE)); |
@@ -846,33 +848,33 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
846 | lnk.setType( "audio/x-mpegurl" ); | 848 | lnk.setType( "audio/x-mpegurl" ); |
847 | 849 | ||
848 | lnk.writeLink(); | 850 | lnk.writeLink(); |
849 | d->selectedFiles->addToSelection( lnk ); | 851 | d->selectedFiles->addToSelection( lnk ); |
850 | } | 852 | } |
851 | 853 | ||
852 | m3uList->close(); | 854 | m3uList->close(); |
853 | if(m3uList) delete m3uList; | 855 | if(m3uList) delete m3uList; |
854 | } | 856 | } |
855 | 857 | ||
856 | /* | 858 | /* |
857 | writes current playlist to current m3u file */ | 859 | writes current playlist to current m3u file */ |
858 | void PlayListWidget::writeCurrentM3u() { | 860 | void PlayListWidget::writeCurrentM3u() { |
859 | qDebug("writing to current m3u"); | 861 | qDebug("writing to current m3u"); |
860 | Config cfg( "OpiePlayer" ); | 862 | Config cfg( "OpiePlayer" ); |
861 | cfg.setGroup("PlayList"); | 863 | cfg.setGroup("PlayList"); |
862 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 864 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist","default"); |
863 | 865 | ||
864 | if( d->selectedFiles->first()) { | 866 | if( d->selectedFiles->first()) { |
865 | Om3u *m3uList; | 867 | Om3u *m3uList; |
866 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); | 868 | m3uList = new Om3u( currentPlaylist, IO_ReadWrite | IO_Truncate ); |
867 | 869 | ||
868 | do { | 870 | do { |
869 | qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); | 871 | qDebug( "writeCurrentM3u " +d->selectedFiles->current()->file()); |
870 | m3uList->add( d->selectedFiles->current()->file() ); | 872 | m3uList->add( d->selectedFiles->current()->file() ); |
871 | } | 873 | } |
872 | while ( d->selectedFiles->next() ); | 874 | while ( d->selectedFiles->next() ); |
873 | qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 875 | qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
874 | m3uList->write(); | 876 | m3uList->write(); |
875 | m3uList->close(); | 877 | m3uList->close(); |
876 | 878 | ||
877 | if(m3uList) delete m3uList; | 879 | if(m3uList) delete m3uList; |
878 | } | 880 | } |