author | harlekin <harlekin> | 2002-07-31 23:56:39 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-07-31 23:56:39 (UTC) |
commit | b2978cf32ae5e6954fb118c89c1f70ee05d53ef4 (patch) (unidiff) | |
tree | c9a90786a9676014cc1abba61bc0828cf61beb67 | |
parent | 3a4d367a8e5e9f599e0487326c105de9aa773bfe (diff) | |
download | opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.zip opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.tar.gz opie-b2978cf32ae5e6954fb118c89c1f70ee05d53ef4.tar.bz2 |
fix
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 9373f6b..cd53748 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -894,134 +894,129 @@ void PlayListWidget::populateAudioView() { | |||
894 | 894 | ||
895 | QString storage; | 895 | QString storage; |
896 | for ( ; dit.current(); ++dit ) { | 896 | for ( ; dit.current(); ++dit ) { |
897 | for( ; it.current(); ++it ){ | 897 | for( ; it.current(); ++it ){ |
898 | const QString name = (*it)->name(); | 898 | const QString name = (*it)->name(); |
899 | const QString path = (*it)->path(); | 899 | const QString path = (*it)->path(); |
900 | if(dit.current()->file().find(path) != -1 ) storage=name; | 900 | if(dit.current()->file().find(path) != -1 ) storage=name; |
901 | } | 901 | } |
902 | 902 | ||
903 | QListViewItem * newItem; | 903 | QListViewItem * newItem; |
904 | if ( QFile( dit.current()->file()).exists() ) { | 904 | if ( QFile( dit.current()->file()).exists() ) { |
905 | // qDebug(dit.current()->name()); | 905 | // qDebug(dit.current()->name()); |
906 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), | 906 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), |
907 | QString::number( QFile( dit.current()->file()).size() ), storage); | 907 | QString::number( QFile( dit.current()->file()).size() ), storage); |
908 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); | 908 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); |
909 | } | 909 | } |
910 | } | 910 | } |
911 | 911 | ||
912 | } | 912 | } |
913 | 913 | ||
914 | void PlayListWidget::populateVideoView() { | 914 | void PlayListWidget::populateVideoView() { |
915 | videoView->clear(); | 915 | videoView->clear(); |
916 | StorageInfo storageInfo; | 916 | StorageInfo storageInfo; |
917 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 917 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
918 | 918 | ||
919 | if(!videoScan ) scanForVideo(); | 919 | if(!videoScan ) scanForVideo(); |
920 | 920 | ||
921 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 921 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
922 | QListIterator<FileSystem> it ( fs ); | 922 | QListIterator<FileSystem> it ( fs ); |
923 | videoView->clear(); | 923 | videoView->clear(); |
924 | QString storage; | 924 | QString storage; |
925 | for ( ; Vdit.current(); ++Vdit ) { | 925 | for ( ; Vdit.current(); ++Vdit ) { |
926 | for( ; it.current(); ++it ){ | 926 | for( ; it.current(); ++it ){ |
927 | const QString name = (*it)->name(); | 927 | const QString name = (*it)->name(); |
928 | const QString path = (*it)->path(); | 928 | const QString path = (*it)->path(); |
929 | if( Vdit.current()->file().find(path) != -1 ) storage=name; | 929 | if( Vdit.current()->file().find(path) != -1 ) storage=name; |
930 | } | 930 | } |
931 | 931 | ||
932 | QListViewItem * newItem; | 932 | QListViewItem * newItem; |
933 | if ( QFile( Vdit.current()->file()).exists() ) { | 933 | if ( QFile( Vdit.current()->file()).exists() ) { |
934 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), | 934 | newItem= /*(void)*/ new QListViewItem( videoView, Vdit.current()->name(), |
935 | QString::number( QFile( Vdit.current()->file()).size() ), storage); | 935 | QString::number( QFile( Vdit.current()->file()).size() ), storage); |
936 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); | 936 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/videofile" )); |
937 | } | 937 | } |
938 | } | 938 | } |
939 | } | 939 | } |
940 | 940 | ||
941 | void PlayListWidget::openFile() { | 941 | void PlayListWidget::openFile() { |
942 | QString filename, name; | 942 | QString filename, name; |
943 | InputDialog *fileDlg; | 943 | InputDialog *fileDlg; |
944 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 944 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
945 | fileDlg->exec(); | 945 | fileDlg->exec(); |
946 | if( fileDlg->result() == 1 ) { | 946 | if( fileDlg->result() == 1 ) { |
947 | filename = fileDlg->LineEdit1->text(); | 947 | filename = fileDlg->LineEdit1->text(); |
948 | 948 | ||
949 | qDebug("Selected filename is "+filename); | 949 | qDebug("Selected filename is "+filename); |
950 | if(filename.right(3) == "m3u") { | 950 | if(filename.right(3) == "m3u") { |
951 | readm3u( filename ); | 951 | readm3u( filename ); |
952 | } else if(filename.right(3) == "pls") { | 952 | } else if(filename.right(3) == "pls") { |
953 | readPls( filename ); | 953 | readPls( filename ); |
954 | } else { | 954 | } else { |
955 | DocLnk lnk; | 955 | DocLnk lnk; |
956 | 956 | ||
957 | lnk.setName(filename); //sets file name | 957 | lnk.setName(filename); //sets file name |
958 | // probably not needed anymore either | ||
959 | if(filename.right(1) != "/" && filename.right(3) != "mp3" && filename.right(3) != "MP3") { | ||
960 | filename += "/"; | ||
961 | } | ||
962 | lnk.setFile(filename); //sets File property | 958 | lnk.setFile(filename); //sets File property |
963 | |||
964 | lnk.setType("audio/x-mpegurl"); | 959 | lnk.setType("audio/x-mpegurl"); |
965 | lnk.setExec("opieplayer"); | 960 | lnk.setExec("opieplayer"); |
966 | lnk.setIcon("opieplayer/MPEGPlayer"); | 961 | lnk.setIcon("opieplayer/MPEGPlayer"); |
967 | 962 | ||
968 | if(!lnk.writeLink()) { | 963 | if(!lnk.writeLink()) { |
969 | qDebug("Writing doclink did not work"); | 964 | qDebug("Writing doclink did not work"); |
970 | } | 965 | } |
971 | d->selectedFiles->addToSelection( lnk); | 966 | d->selectedFiles->addToSelection( lnk); |
972 | } | 967 | } |
973 | } | 968 | } |
974 | if(fileDlg) { | 969 | if(fileDlg) { |
975 | delete fileDlg; | 970 | delete fileDlg; |
976 | } | 971 | } |
977 | } | 972 | } |
978 | 973 | ||
979 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | 974 | void PlayListWidget::keyReleaseEvent( QKeyEvent *e) |
980 | { | 975 | { |
981 | switch ( e->key() ) { | 976 | switch ( e->key() ) { |
982 | ////////////////////////////// Zaurus keys | 977 | ////////////////////////////// Zaurus keys |
983 | case Key_F9: //activity | 978 | case Key_F9: //activity |
984 | // if(audioUI->isHidden()) | 979 | // if(audioUI->isHidden()) |
985 | // audioUI->showMaximized(); | 980 | // audioUI->showMaximized(); |
986 | break; | 981 | break; |
987 | case Key_F10: //contacts | 982 | case Key_F10: //contacts |
988 | // if( videoUI->isHidden()) | 983 | // if( videoUI->isHidden()) |
989 | // videoUI->showMaximized(); | 984 | // videoUI->showMaximized(); |
990 | break; | 985 | break; |
991 | case Key_F11: //menu | 986 | case Key_F11: //menu |
992 | break; | 987 | break; |
993 | case Key_F12: //home | 988 | case Key_F12: //home |
994 | // doBlank(); | 989 | // doBlank(); |
995 | break; | 990 | break; |
996 | case Key_F13: //mail | 991 | case Key_F13: //mail |
997 | // doUnblank(); | 992 | // doUnblank(); |
998 | break; | 993 | break; |
999 | case Key_Q: //add to playlist | 994 | case Key_Q: //add to playlist |
1000 | qDebug("Add"); | 995 | qDebug("Add"); |
1001 | addSelected(); | 996 | addSelected(); |
1002 | break; | 997 | break; |
1003 | case Key_R: //remove from playlist | 998 | case Key_R: //remove from playlist |
1004 | removeSelected(); | 999 | removeSelected(); |
1005 | break; | 1000 | break; |
1006 | // case Key_P: //play | 1001 | // case Key_P: //play |
1007 | // qDebug("Play"); | 1002 | // qDebug("Play"); |
1008 | // playSelected(); | 1003 | // playSelected(); |
1009 | // break; | 1004 | // break; |
1010 | case Key_Space: | 1005 | case Key_Space: |
1011 | qDebug("Play"); | 1006 | qDebug("Play"); |
1012 | // playSelected(); puh | 1007 | // playSelected(); puh |
1013 | break; | 1008 | break; |
1014 | case Key_1: | 1009 | case Key_1: |
1015 | tabWidget->setCurrentPage(0); | 1010 | tabWidget->setCurrentPage(0); |
1016 | break; | 1011 | break; |
1017 | case Key_2: | 1012 | case Key_2: |
1018 | tabWidget->setCurrentPage(1); | 1013 | tabWidget->setCurrentPage(1); |
1019 | break; | 1014 | break; |
1020 | case Key_3: | 1015 | case Key_3: |
1021 | tabWidget->setCurrentPage(2); | 1016 | tabWidget->setCurrentPage(2); |
1022 | break; | 1017 | break; |
1023 | case Key_4: | 1018 | case Key_4: |
1024 | tabWidget->setCurrentPage(3); | 1019 | tabWidget->setCurrentPage(3); |
1025 | break; | 1020 | break; |
1026 | case Key_Down: | 1021 | case Key_Down: |
1027 | if ( !d->selectedFiles->next() ) | 1022 | if ( !d->selectedFiles->next() ) |