summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index 1dee422..9065d63 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -795,102 +795,101 @@ void PlayListWidget::deletePlaylist() {
795 795
796void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) { 796void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) {
797 switch (mouse) { 797 switch (mouse) {
798 case 1: 798 case 1:
799 break; 799 break;
800 case 2:{ 800 case 2:{
801 QPopupMenu m; 801 QPopupMenu m;
802 m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); 802 m.insertItem( tr( "Play" ), this, SLOT( playSelected() ));
803 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); 803 m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() ));
804 m.insertSeparator(); 804 m.insertSeparator();
805 m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); 805 m.insertItem( tr( "Properties" ), this, SLOT( listDelete() ));
806 m.exec( QCursor::pos() ); 806 m.exec( QCursor::pos() );
807 } 807 }
808 break; 808 break;
809 }; 809 };
810} 810}
811 811
812void PlayListWidget::playSelected() { 812void PlayListWidget::playSelected() {
813 btnPlay( TRUE); 813 btnPlay( TRUE);
814} 814}
815 815
816void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) { 816void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const QPoint& point, int i) {
817 switch (mouse) { 817 switch (mouse) {
818 case 1: 818 case 1:
819 819
820 break; 820 break;
821 case 2: 821 case 2:
822 { 822 {
823 QPopupMenu m; 823 QPopupMenu m;
824 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); 824 m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() ));
825 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); 825 m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() ));
826 m.exec( QCursor::pos() ); 826 m.exec( QCursor::pos() );
827 } 827 }
828 break; 828 break;
829 }; 829 };
830} 830}
831 831
832void PlayListWidget::listDelete() { 832void PlayListWidget::listDelete() {
833 Config cfg( "OpiePlayer" ); 833 Config cfg( "OpiePlayer" );
834 cfg.setGroup("PlayList"); 834 cfg.setGroup("PlayList");
835 QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); 835 QString currentPlaylist = cfg.readEntry("CurrentPlaylist","");
836 QString file; 836 QString file;
837 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); 837 int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 );
838 switch ( tabWidget->currentPageIndex()) { 838 switch ( tabWidget->currentPageIndex()) {
839 case 0: 839 case 0:
840 break; 840 break;
841 case 1: 841 case 1:
842 { 842 {
843 file = audioView->selectedItem()->text(0); 843 file = audioView->currentItem()->text(0);
844 QListIterator<DocLnk> dit( files.children() ); 844 QListIterator<DocLnk> Pdit( files.children() );
845 for ( ; dit.current(); ++dit ) { 845 for ( ; Pdit.current(); ++Pdit ) {
846 if( dit.current()->name() == file) { 846 if( Pdit.current()->name() == file) {
847 // qDebug(file); 847 LnkProperties prop( Pdit.current() );
848 LnkProperties prop( dit.current() );
849 prop.showMaximized(); 848 prop.showMaximized();
850 prop.exec(); 849 prop.exec();
851 } 850 }
852 } 851 }
853 populateAudioView(); 852 populateAudioView();
854 } 853 }
855 break; 854 break;
856 case 2: 855 case 2:
857 { 856 {
858 857
859 } 858 }
860 break; 859 break;
861 }; 860 };
862} 861}
863 862
864void PlayListWidget::scanForAudio() { 863void PlayListWidget::scanForAudio() {
865 qDebug("scan for audio"); 864 qDebug("scan for audio");
866 files.detachChildren(); 865 files.detachChildren();
867 QListIterator<DocLnk> sdit( files.children() ); 866 QListIterator<DocLnk> sdit( files.children() );
868 for ( ; sdit.current(); ++sdit ) { 867 for ( ; sdit.current(); ++sdit ) {
869 delete sdit.current(); 868 delete sdit.current();
870 } 869 }
871 Global::findDocuments(&files, "audio/*"); 870 Global::findDocuments(&files, "audio/*");
872 audioScan = TRUE; 871 audioScan = TRUE;
873} 872}
874void PlayListWidget::scanForVideo() { 873void PlayListWidget::scanForVideo() {
875 qDebug("scan for video"); 874 qDebug("scan for video");
876 vFiles.detachChildren(); 875 vFiles.detachChildren();
877 QListIterator<DocLnk> sdit( vFiles.children() ); 876 QListIterator<DocLnk> sdit( vFiles.children() );
878 for ( ; sdit.current(); ++sdit ) { 877 for ( ; sdit.current(); ++sdit ) {
879 delete sdit.current(); 878 delete sdit.current();
880 } 879 }
881 Global::findDocuments(&vFiles, "video/*"); 880 Global::findDocuments(&vFiles, "video/*");
882 videoScan = TRUE; 881 videoScan = TRUE;
883} 882}
884 883
885void PlayListWidget::populateAudioView() { 884void PlayListWidget::populateAudioView() {
886 885
887 audioView->clear(); 886 audioView->clear();
888 StorageInfo storageInfo; 887 StorageInfo storageInfo;
889 const QList<FileSystem> &fs = storageInfo.fileSystems(); 888 const QList<FileSystem> &fs = storageInfo.fileSystems();
890 if(!audioScan) scanForAudio(); 889 if(!audioScan) scanForAudio();
891 890
892 QListIterator<DocLnk> dit( files.children() ); 891 QListIterator<DocLnk> dit( files.children() );
893 QListIterator<FileSystem> it ( fs ); 892 QListIterator<FileSystem> it ( fs );
894 893
895 QString storage; 894 QString storage;
896 for ( ; dit.current(); ++dit ) { 895 for ( ; dit.current(); ++dit ) {