summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-10-08 19:37:34 (UTC)
committer llornkcor <llornkcor>2002-10-08 19:37:34 (UTC)
commitb81a4afcb4d363bf1ee50aa7b43a1f1566addc9d (patch) (unidiff)
tree60246a741e7895f5efe6755c2aee455376ca0939
parentde9496b2e6e2784dc4cc83dd5800f89f0954affc (diff)
downloadopie-b81a4afcb4d363bf1ee50aa7b43a1f1566addc9d.zip
opie-b81a4afcb4d363bf1ee50aa7b43a1f1566addc9d.tar.gz
opie-b81a4afcb4d363bf1ee50aa7b43a1f1566addc9d.tar.bz2
more fixes 2
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp25
1 files changed, 8 insertions, 17 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index cc4be23..c0d3108 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -497,7 +497,7 @@ void PlayListWidget::playIt( QListViewItem *it) {
497 497
498void PlayListWidget::addToSelection( QListViewItem *it) { 498void PlayListWidget::addToSelection( QListViewItem *it) {
499 d->setDocumentUsed = FALSE; 499 d->setDocumentUsed = FALSE;
500 qDebug("addToSelection2"); 500
501 if(it) { 501 if(it) {
502 switch ( whichList()) { 502 switch ( whichList()) {
503 case 1: { 503 case 1: {
@@ -723,30 +723,21 @@ void PlayListWidget::openFile() {
723 m3uFile=filename; 723 m3uFile=filename;
724 } 724 }
725 725
726 qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile); 726// qDebug("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"+ m3uFile);
727 m3uList = new Om3u( cfg.readEntry("CurrentPlaylist",""), IO_Append | IO_ReadWrite );
728 m3uList->add( filename);
729 m3uList->write();
730 m3uList->close();
731 if(m3uList) delete m3uList;
732 lnk.setName( filename ); //sets name 727 lnk.setName( filename ); //sets name
733 lnk.setFile( filename ); //sets file name 728 lnk.setFile( filename ); //sets file name
734 lnk.setIcon("opieplayer2/musicfile"); 729 lnk.setIcon("opieplayer2/musicfile");
735 d->selectedFiles->addToSelection( lnk ); 730 d->selectedFiles->addToSelection( lnk );
731 writeCurrentM3u();
736 } 732 }
737 else if( filename.right( 3) == "m3u" ) { 733 else if( filename.right( 3) == "m3u" ) {
738 readm3u( filename ); 734 readm3u( filename );
739 735
740 } else if( filename.right(3) == "pls" ) { 736 } else if( filename.right(3) == "pls" ) {
741 readPls( filename ); 737 readPls( filename );
742 } 738 } else {
743 else {
744 m3uList = new Om3u( cfg.readEntry("CurrentPlaylist",""), IO_Append | IO_ReadWrite );
745 m3uList->add( filename);
746 m3uList->write();
747 m3uList->close();
748 if(m3uList) delete m3uList;
749 d->selectedFiles->addToSelection( DocLnk(filename) ); 739 d->selectedFiles->addToSelection( DocLnk(filename) );
740 writeCurrentM3u();
750 } 741 }
751 } 742 }
752 743
@@ -849,7 +840,7 @@ void PlayListWidget::readPls( const QString &filename ) {
849/* 840/*
850 writes current playlist to current m3u file */ 841 writes current playlist to current m3u file */
851void PlayListWidget::writeCurrentM3u() { 842void PlayListWidget::writeCurrentM3u() {
852 qDebug("writting to current m3u"); 843 qDebug("writing to current m3u");
853 Config cfg( "OpiePlayer" ); 844 Config cfg( "OpiePlayer" );
854 cfg.setGroup("PlayList"); 845 cfg.setGroup("PlayList");
855 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 846 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
@@ -862,7 +853,7 @@ void PlayListWidget::writeCurrentM3u() {
862 m3uList->add( d->selectedFiles->current()->file()); 853 m3uList->add( d->selectedFiles->current()->file());
863 } 854 }
864 while ( d->selectedFiles->next() ); 855 while ( d->selectedFiles->next() );
865 // qDebug( list ); 856// qDebug( list );
866 m3uList->write(); 857 m3uList->write();
867 m3uList->close(); 858 m3uList->close();
868 859
@@ -880,7 +871,7 @@ void PlayListWidget::writem3u() {
880 871
881 if( fileDlg->result() == 1 ) { 872 if( fileDlg->result() == 1 ) {
882 name = fileDlg->text(); 873 name = fileDlg->text();
883 qDebug( filename ); 874// qDebug( filename );
884 875
885 if( name.left( 1) != "/" ) { 876 if( name.left( 1) != "/" ) {
886 filename = QPEApplication::documentDir() + "/" + name; 877 filename = QPEApplication::documentDir() + "/" + name;