-rw-r--r-- | noncore/multimedia/opieplayer2/playlistselection.cpp | 3 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 16 |
2 files changed, 8 insertions, 11 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.cpp b/noncore/multimedia/opieplayer2/playlistselection.cpp index 975dec3..2019b3a 100644 --- a/noncore/multimedia/opieplayer2/playlistselection.cpp +++ b/noncore/multimedia/opieplayer2/playlistselection.cpp | |||
@@ -111,14 +111,13 @@ void PlayListSelection::addToSelection( const DocLnk &lnk ) { | |||
111 | ensureItemVisible( selectedItem() ); | 111 | ensureItemVisible( selectedItem() ); |
112 | } | 112 | } |
113 | 113 | ||
114 | 114 | ||
115 | void PlayListSelection::removeSelected() { | 115 | void PlayListSelection::removeSelected() { |
116 | QListViewItem *item = selectedItem(); | 116 | QListViewItem *item = selectedItem(); |
117 | if ( item ) | 117 | delete item; |
118 | delete item; | ||
119 | setSelected( currentItem(), TRUE ); | 118 | setSelected( currentItem(), TRUE ); |
120 | ensureItemVisible( selectedItem() ); | 119 | ensureItemVisible( selectedItem() ); |
121 | } | 120 | } |
122 | 121 | ||
123 | 122 | ||
124 | void PlayListSelection::moveSelectedUp() { | 123 | void PlayListSelection::moveSelectedUp() { |
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 86b3424..ac52b07 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -188,13 +188,13 @@ void PlayListWidget::writeDefaultPlaylist() { | |||
188 | m3uList->add( d->selectedFiles->current()->file() ); | 188 | m3uList->add( d->selectedFiles->current()->file() ); |
189 | } | 189 | } |
190 | while ( d->selectedFiles->next() ); | 190 | while ( d->selectedFiles->next() ); |
191 | 191 | ||
192 | m3uList->write(); | 192 | m3uList->write(); |
193 | m3uList->close(); | 193 | m3uList->close(); |
194 | if(m3uList) delete m3uList; | 194 | delete m3uList; |
195 | 195 | ||
196 | } | 196 | } |
197 | } | 197 | } |
198 | } | 198 | } |
199 | 199 | ||
200 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { | 200 | void PlayListWidget::addToSelection( const DocLnk& lnk ) { |
@@ -681,15 +681,13 @@ void PlayListWidget::openFile() { | |||
681 | d->selectedFiles->addToSelection( lnk); | 681 | d->selectedFiles->addToSelection( lnk); |
682 | writeCurrentM3u(); | 682 | writeCurrentM3u(); |
683 | d->selectedFiles->setSelectedItem( lnk.name()); | 683 | d->selectedFiles->setSelectedItem( lnk.name()); |
684 | } | 684 | } |
685 | } | 685 | } |
686 | 686 | ||
687 | if( fileDlg ) { | 687 | delete fileDlg; |
688 | delete fileDlg; | ||
689 | } | ||
690 | } | 688 | } |
691 | 689 | ||
692 | /* | 690 | /* |
693 | reads m3u and shows files/urls to playlist widget */ | 691 | reads m3u and shows files/urls to playlist widget */ |
694 | void PlayListWidget::readm3u( const QString &filename ) { | 692 | void PlayListWidget::readm3u( const QString &filename ) { |
695 | qDebug( "read m3u filename " + filename ); | 693 | qDebug( "read m3u filename " + filename ); |
@@ -731,13 +729,13 @@ void PlayListWidget::readm3u( const QString &filename ) { | |||
731 | config.writeEntry("CurrentPlaylist",filename); | 729 | config.writeEntry("CurrentPlaylist",filename); |
732 | config.write(); | 730 | config.write(); |
733 | currentPlayList=filename; | 731 | currentPlayList=filename; |
734 | 732 | ||
735 | // m3uList->write(); | 733 | // m3uList->write(); |
736 | m3uList->close(); | 734 | m3uList->close(); |
737 | if(m3uList) delete m3uList; | 735 | delete m3uList; |
738 | 736 | ||
739 | d->selectedFiles->setSelectedItem( s); | 737 | d->selectedFiles->setSelectedItem( s); |
740 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); | 738 | setCaption(tr("OpiePlayer: ")+ QFileInfo(filename).baseName()); |
741 | 739 | ||
742 | } | 740 | } |
743 | 741 | ||
@@ -779,13 +777,13 @@ void PlayListWidget::readPls( const QString &filename ) { | |||
779 | 777 | ||
780 | lnk.writeLink(); | 778 | lnk.writeLink(); |
781 | d->selectedFiles->addToSelection( lnk ); | 779 | d->selectedFiles->addToSelection( lnk ); |
782 | } | 780 | } |
783 | 781 | ||
784 | m3uList->close(); | 782 | m3uList->close(); |
785 | if(m3uList) delete m3uList; | 783 | delete m3uList; |
786 | } | 784 | } |
787 | 785 | ||
788 | /* | 786 | /* |
789 | writes current playlist to current m3u file */ | 787 | writes current playlist to current m3u file */ |
790 | void PlayListWidget::writeCurrentM3u() { | 788 | void PlayListWidget::writeCurrentM3u() { |
791 | qDebug("writing to current m3u"); | 789 | qDebug("writing to current m3u"); |
@@ -803,13 +801,13 @@ void PlayListWidget::writeCurrentM3u() { | |||
803 | } | 801 | } |
804 | while ( d->selectedFiles->next() ); | 802 | while ( d->selectedFiles->next() ); |
805 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); | 803 | // qDebug( "<<<<<<<<<<<<>>>>>>>>>>>>>>>>>" ); |
806 | m3uList->write(); | 804 | m3uList->write(); |
807 | m3uList->close(); | 805 | m3uList->close(); |
808 | 806 | ||
809 | if(m3uList) delete m3uList; | 807 | delete m3uList; |
810 | } | 808 | } |
811 | 809 | ||
812 | } | 810 | } |
813 | 811 | ||
814 | /* | 812 | /* |
815 | writes current playlist to m3u file */ | 813 | writes current playlist to m3u file */ |
@@ -839,15 +837,15 @@ void PlayListWidget::writem3u() { | |||
839 | m3uList->add( d->selectedFiles->current()->file()); | 837 | m3uList->add( d->selectedFiles->current()->file()); |
840 | } | 838 | } |
841 | while ( d->selectedFiles->next() ); | 839 | while ( d->selectedFiles->next() ); |
842 | // qDebug( list ); | 840 | // qDebug( list ); |
843 | m3uList->write(); | 841 | m3uList->write(); |
844 | m3uList->close(); | 842 | m3uList->close(); |
845 | if(m3uList) delete m3uList; | 843 | delete m3uList; |
846 | 844 | ||
847 | if(fileDlg) delete fileDlg; | 845 | delete fileDlg; |
848 | 846 | ||
849 | DocLnk lnk; | 847 | DocLnk lnk; |
850 | lnk.setFile( filename); | 848 | lnk.setFile( filename); |
851 | lnk.setIcon("opieplayer2/playlist2"); | 849 | lnk.setIcon("opieplayer2/playlist2"); |
852 | lnk.setName( name); //sets file name | 850 | lnk.setName( name); //sets file name |
853 | 851 | ||