author | llornkcor <llornkcor> | 2002-05-12 12:15:30 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-12 12:15:30 (UTC) |
commit | c1cc5edca5d6d71350f841892fb7828f7be9ed9f (patch) (unidiff) | |
tree | 014224506a39db65d54c41b18c5f7c1096cb7a92 | |
parent | 06e723cc7942af2691828e7fdc6a6ec47b44edab (diff) | |
download | opie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.zip opie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.tar.gz opie-c1cc5edca5d6d71350f841892fb7828f7be9ed9f.tar.bz2 |
added a few keyboard shorts
-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 139 |
1 files changed, 133 insertions, 6 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 038b371..ec5500f 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -29,33 +29,33 @@ | |||
29 | #include <qpe/storage.h> | 29 | #include <qpe/storage.h> |
30 | 30 | ||
31 | #include <qpe/applnk.h> | 31 | #include <qpe/applnk.h> |
32 | #include <qpe/config.h> | 32 | #include <qpe/config.h> |
33 | #include <qpe/global.h> | 33 | #include <qpe/global.h> |
34 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | 35 | ||
36 | #include <qaction.h> | 36 | #include <qaction.h> |
37 | #include <qcursor.h> | ||
38 | #include <qimage.h> | 37 | #include <qimage.h> |
39 | #include <qfile.h> | 38 | #include <qfile.h> |
40 | #include <qdir.h> | 39 | #include <qdir.h> |
41 | #include <qlayout.h> | 40 | #include <qlayout.h> |
42 | #include <qlabel.h> | 41 | #include <qlabel.h> |
43 | #include <qlist.h> | 42 | #include <qlist.h> |
44 | #include <qlistbox.h> | 43 | #include <qlistbox.h> |
45 | #include <qmainwindow.h> | 44 | #include <qmainwindow.h> |
46 | #include <qmessagebox.h> | 45 | #include <qmessagebox.h> |
47 | #include <qtoolbutton.h> | 46 | #include <qtoolbutton.h> |
48 | #include <qtabwidget.h> | 47 | #include <qtabwidget.h> |
49 | #include <qlistview.h> | 48 | #include <qlistview.h> |
50 | #include <qpoint.h> | 49 | #include <qpoint.h> |
51 | #include <qlineedit.h> | 50 | #include <qlineedit.h> |
52 | #include <qpushbutton.h> | 51 | #include <qpushbutton.h> |
53 | #include <qregexp.h> | 52 | #include <qregexp.h> |
53 | #include <qtextstream.h> | ||
54 | 54 | ||
55 | //#include <qtimer.h> | 55 | //#include <qtimer.h> |
56 | 56 | ||
57 | #include "playlistselection.h" | 57 | #include "playlistselection.h" |
58 | #include "playlistwidget.h" | 58 | #include "playlistwidget.h" |
59 | #include "mediaplayerstate.h" | 59 | #include "mediaplayerstate.h" |
60 | 60 | ||
61 | #include "inputDialog.h" | 61 | #include "inputDialog.h" |
@@ -244,16 +244,18 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
244 | audioView->setSelectionMode( QListView::Extended); | 244 | audioView->setSelectionMode( QListView::Extended); |
245 | 245 | ||
246 | tabWidget->insertTab(aTab,tr("Audio")); | 246 | tabWidget->insertTab(aTab,tr("Audio")); |
247 | 247 | ||
248 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); | 248 | QPEApplication::setStylusOperation( audioView->viewport(),QPEApplication::RightOnHold); |
249 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 249 | connect( audioView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
250 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 250 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
251 | 251 | ||
252 | connect( audioView, SIGNAL( returnPressed( QListViewItem *)), | ||
253 | this,SLOT( playIt( QListViewItem *)) ); | ||
252 | 254 | ||
253 | // audioView | 255 | // audioView |
254 | populateAudioView(); | 256 | populateAudioView(); |
255 | // videowidget | 257 | // videowidget |
256 | 258 | ||
257 | QWidget *vTab; | 259 | QWidget *vTab; |
258 | vTab = new QWidget( tabWidget, "vTab" ); | 260 | vTab = new QWidget( tabWidget, "vTab" ); |
259 | videoView = new QListView( vTab, "Videoview" ); | 261 | videoView = new QListView( vTab, "Videoview" ); |
@@ -264,18 +266,21 @@ PlayListWidget::PlayListWidget( QWidget* parent, const char* name, WFlags fl ) | |||
264 | videoView->addColumn(tr("Media"),-1); | 266 | videoView->addColumn(tr("Media"),-1); |
265 | videoView->setColumnAlignment(1, Qt::AlignRight); | 267 | videoView->setColumnAlignment(1, Qt::AlignRight); |
266 | videoView->setColumnAlignment(2, Qt::AlignRight); | 268 | videoView->setColumnAlignment(2, Qt::AlignRight); |
267 | videoView->setAllColumnsShowFocus(TRUE); | 269 | videoView->setAllColumnsShowFocus(TRUE); |
268 | videoView->setMultiSelection( TRUE ); | 270 | videoView->setMultiSelection( TRUE ); |
269 | videoView->setSelectionMode( QListView::Extended); | 271 | videoView->setSelectionMode( QListView::Extended); |
270 | 272 | ||
271 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); | 273 | QPEApplication::setStylusOperation( videoView->viewport(),QPEApplication::RightOnHold); |
274 | |||
272 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), | 275 | connect( videoView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), |
273 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); | 276 | this,SLOT( viewPressed(int, QListViewItem *, const QPoint&, int)) ); |
277 | connect( videoView, SIGNAL( returnPressed( QListViewItem *)), | ||
278 | this,SLOT( playIt( QListViewItem *)) ); | ||
274 | 279 | ||
275 | tabWidget->insertTab( vTab,tr("Video")); | 280 | tabWidget->insertTab( vTab,tr("Video")); |
276 | populateVideoView(); | 281 | populateVideoView(); |
277 | 282 | ||
278 | //playlists list | 283 | //playlists list |
279 | QWidget *LTab; | 284 | QWidget *LTab; |
280 | LTab = new QWidget( tabWidget, "LTab" ); | 285 | LTab = new QWidget( tabWidget, "LTab" ); |
281 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy | 286 | playLists = new FileSelector( "playlist/plain", LTab, "fileselector" , FALSE, FALSE); //buggy |
@@ -829,35 +834,39 @@ void PlayListWidget::btnPlay(bool b) { | |||
829 | switch ( tabWidget->currentPageIndex()) { | 834 | switch ( tabWidget->currentPageIndex()) { |
830 | case 0: | 835 | case 0: |
831 | { | 836 | { |
832 | mediaPlayerState->setPlaying(b); | 837 | mediaPlayerState->setPlaying(b); |
833 | } | 838 | } |
834 | break; | 839 | break; |
835 | case 1: | 840 | case 1: |
836 | { | 841 | { |
842 | // if(audioView->selectedItem()) { | ||
837 | addToSelection( audioView->selectedItem() ); | 843 | addToSelection( audioView->selectedItem() ); |
838 | mediaPlayerState->setPlaying(b); | 844 | mediaPlayerState->setPlaying(b); |
839 | d->selectedFiles->removeSelected( ); | 845 | d->selectedFiles->removeSelected( ); |
840 | tabWidget->setCurrentPage(1); | 846 | tabWidget->setCurrentPage(1); |
841 | d->selectedFiles->unSelect(); | 847 | d->selectedFiles->unSelect(); |
842 | insanityBool=FALSE; | 848 | insanityBool=FALSE; |
843 | // audioView->clearSelection(); | 849 | // audioView->clearSelection(); |
850 | // } | ||
844 | } | 851 | } |
845 | break; | 852 | break; |
846 | case 2: | 853 | case 2: |
847 | { | 854 | { |
855 | // if(videoView->selectedItem() ) { | ||
848 | addToSelection( videoView->selectedItem() ); | 856 | addToSelection( videoView->selectedItem() ); |
849 | mediaPlayerState->setPlaying(b); | 857 | mediaPlayerState->setPlaying(b); |
850 | qApp->processEvents(); | 858 | qApp->processEvents(); |
851 | d->selectedFiles->removeSelected( ); | 859 | d->selectedFiles->removeSelected( ); |
852 | tabWidget->setCurrentPage(2); | 860 | tabWidget->setCurrentPage(2); |
853 | d->selectedFiles->unSelect(); | 861 | d->selectedFiles->unSelect(); |
854 | insanityBool=FALSE; | 862 | insanityBool=FALSE; |
855 | // videoView->clearSelection(); | 863 | // videoView->clearSelection(); |
864 | // } | ||
856 | } | 865 | } |
857 | break; | 866 | break; |
858 | }; | 867 | }; |
859 | } | 868 | } |
860 | 869 | ||
861 | void PlayListWidget::deletePlaylist() { | 870 | void PlayListWidget::deletePlaylist() { |
862 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), | 871 | switch( QMessageBox::information( this, (tr("Remove Playlist?")), |
863 | (tr("You really want to delete\nthis playlist?")), | 872 | (tr("You really want to delete\nthis playlist?")), |
@@ -878,17 +887,19 @@ void PlayListWidget::viewPressed( int mouse, QListViewItem *item, const QPoint& | |||
878 | switch (mouse) { | 887 | switch (mouse) { |
879 | case 1: | 888 | case 1: |
880 | break; | 889 | break; |
881 | case 2:{ | 890 | case 2:{ |
882 | QPopupMenu m; | 891 | QPopupMenu m; |
883 | m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); | 892 | m.insertItem( tr( "Play" ), this, SLOT( playSelected() )); |
884 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); | 893 | m.insertItem( tr( "Add to Playlist" ), this, SLOT( addSelected() )); |
885 | m.insertSeparator(); | 894 | m.insertSeparator(); |
895 | if( QFile(QPEApplication::qpeDir()+"lib/libopie.so").exists() ) | ||
886 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); | 896 | m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); |
897 | |||
887 | m.exec( QCursor::pos() ); | 898 | m.exec( QCursor::pos() ); |
888 | } | 899 | } |
889 | break; | 900 | break; |
890 | }; | 901 | }; |
891 | } | 902 | } |
892 | 903 | ||
893 | void PlayListWidget::playSelected() | 904 | void PlayListWidget::playSelected() |
894 | { | 905 | { |
@@ -901,32 +912,33 @@ void PlayListWidget::playlistViewPressed( int mouse, QListViewItem *item, const | |||
901 | switch (mouse) { | 912 | switch (mouse) { |
902 | case 1: | 913 | case 1: |
903 | 914 | ||
904 | break; | 915 | break; |
905 | case 2:{ | 916 | case 2:{ |
906 | QPopupMenu m; | 917 | QPopupMenu m; |
907 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); | 918 | m.insertItem( tr( "Play Selected" ), this, SLOT( playSelected() )); |
908 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); | 919 | m.insertItem( tr( "Remove" ), this, SLOT( removeSelected() )); |
909 | // m.insertSeparator(); | 920 | // m.insertSeparator(); |
921 | // m.insertItem( tr( "Properties" ), this, SLOT( listDelete() )); | ||
910 | m.exec( QCursor::pos() ); | 922 | m.exec( QCursor::pos() ); |
911 | } | 923 | } |
912 | break; | 924 | break; |
913 | }; | 925 | }; |
914 | 926 | ||
915 | } | 927 | } |
916 | 928 | ||
917 | void PlayListWidget::listDelete() { | 929 | void PlayListWidget::listDelete() { |
918 | Config cfg( "OpiePlayer" ); | 930 | Config cfg( "OpiePlayer" ); |
919 | cfg.setGroup("PlayList"); | 931 | cfg.setGroup("PlayList"); |
920 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); | 932 | QString currentPlaylist = cfg.readEntry("CurrentPlaylist",""); |
921 | QString file; | 933 | QString file; |
922 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); | 934 | int noOfFiles = cfg.readNumEntry("NumberOfFiles", 0 ); |
923 | switch ( tabWidget->currentPageIndex()) { | 935 | switch ( tabWidget->currentPageIndex()) { |
924 | case 0: | 936 | case 0: |
925 | break; | 937 | break; |
926 | case 1: | 938 | case 1: |
927 | { | 939 | { |
928 | file = audioView->selectedItem()->text(0); | 940 | file = audioView->selectedItem()->text(0); |
929 | // Global::findDocuments(&files, "audio/*"); | 941 | // Global::findDocuments(&files, "audio/*"); |
930 | // AppLnkSet appFiles; | 942 | // AppLnkSet appFiles; |
931 | QListIterator<DocLnk> dit( files.children() ); | 943 | QListIterator<DocLnk> dit( files.children() ); |
932 | for ( ; dit.current(); ++dit ) { | 944 | for ( ; dit.current(); ++dit ) { |
@@ -980,16 +992,17 @@ void PlayListWidget::populateAudioView() { | |||
980 | } | 992 | } |
981 | 993 | ||
982 | QListViewItem * newItem; | 994 | QListViewItem * newItem; |
983 | if ( QFile( dit.current()->file()).exists() ) { | 995 | if ( QFile( dit.current()->file()).exists() ) { |
984 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); | 996 | newItem= /*(void)*/ new QListViewItem( audioView, dit.current()->name(), QString::number( QFile( dit.current()->file()).size() ), storage); |
985 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); | 997 | newItem->setPixmap(0, Resource::loadPixmap( "opieplayer/musicfile" )); |
986 | } | 998 | } |
987 | } | 999 | } |
1000 | |||
988 | } | 1001 | } |
989 | 1002 | ||
990 | void PlayListWidget::populateVideoView() { | 1003 | void PlayListWidget::populateVideoView() { |
991 | StorageInfo storageInfo; | 1004 | StorageInfo storageInfo; |
992 | const QList<FileSystem> &fs = storageInfo.fileSystems(); | 1005 | const QList<FileSystem> &fs = storageInfo.fileSystems(); |
993 | 1006 | ||
994 | Global::findDocuments(&vFiles, "video/*"); | 1007 | Global::findDocuments(&vFiles, "video/*"); |
995 | QListIterator<DocLnk> Vdit( vFiles.children() ); | 1008 | QListIterator<DocLnk> Vdit( vFiles.children() ); |
@@ -1013,19 +1026,19 @@ void PlayListWidget::populateVideoView() { | |||
1013 | 1026 | ||
1014 | void PlayListWidget::openFile() { | 1027 | void PlayListWidget::openFile() { |
1015 | QString filename, name; | 1028 | QString filename, name; |
1016 | InputDialog *fileDlg; | 1029 | InputDialog *fileDlg; |
1017 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); | 1030 | fileDlg = new InputDialog(this,tr("Open file or URL"),TRUE, 0); |
1018 | fileDlg->exec(); | 1031 | fileDlg->exec(); |
1019 | if( fileDlg->result() == 1 ) { | 1032 | if( fileDlg->result() == 1 ) { |
1020 | filename = fileDlg->LineEdit1->text(); | 1033 | filename = fileDlg->LineEdit1->text(); |
1021 | //http://205.188.234.129:8030 | 1034 | // http://205.188.234.129:8030 |
1022 | // http://66.28.68.70:8000 | 1035 | // http://66.28.68.70:8000 |
1023 | qDebug(filename); | 1036 | qDebug("Selected filename is "+filename); |
1024 | if(filename.right(3) == "m3u") | 1037 | if(filename.right(3) == "m3u") |
1025 | readm3u( filename); | 1038 | readm3u( filename); |
1026 | else if(filename.right(3) == "pls") | 1039 | else if(filename.right(3) == "pls") |
1027 | readPls( filename); | 1040 | readPls( filename); |
1028 | else { | 1041 | else { |
1029 | DocLnk lnk; | 1042 | DocLnk lnk; |
1030 | 1043 | ||
1031 | lnk.setName(filename); //sets file name | 1044 | lnk.setName(filename); //sets file name |
@@ -1063,20 +1076,69 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1063 | case Key_F11: //menu | 1076 | case Key_F11: //menu |
1064 | break; | 1077 | break; |
1065 | case Key_F12: //home | 1078 | case Key_F12: //home |
1066 | // doBlank(); | 1079 | // doBlank(); |
1067 | break; | 1080 | break; |
1068 | case Key_F13: //mail | 1081 | case Key_F13: //mail |
1069 | // doUnblank(); | 1082 | // doUnblank(); |
1070 | break; | 1083 | break; |
1071 | 1084 | case Key_Q: //add to playlist | |
1085 | qDebug("Add"); | ||
1086 | addSelected(); | ||
1087 | break; | ||
1088 | case Key_R: //remove from playlist | ||
1089 | removeSelected(); | ||
1090 | break; | ||
1091 | // case Key_P: //play | ||
1092 | // qDebug("Play"); | ||
1093 | // playSelected(); | ||
1094 | // break; | ||
1095 | case Key_Space: | ||
1096 | qDebug("Play"); | ||
1097 | playSelected(); | ||
1098 | break; | ||
1099 | case Key_1: | ||
1100 | tabWidget->setCurrentPage(0); | ||
1101 | break; | ||
1102 | case Key_2: | ||
1103 | tabWidget->setCurrentPage(1); | ||
1104 | break; | ||
1105 | case Key_3: | ||
1106 | tabWidget->setCurrentPage(2); | ||
1107 | break; | ||
1108 | case Key_4: | ||
1109 | tabWidget->setCurrentPage(3); | ||
1110 | break; | ||
1072 | } | 1111 | } |
1073 | } | 1112 | } |
1074 | 1113 | ||
1114 | void PlayListWidget::keyPressEvent( QKeyEvent *e) | ||
1115 | { | ||
1116 | // qDebug("Key press"); | ||
1117 | // switch ( e->key() ) { | ||
1118 | // ////////////////////////////// Zaurus keys | ||
1119 | // case Key_A: //add to playlist | ||
1120 | // qDebug("Add"); | ||
1121 | // addSelected(); | ||
1122 | // break; | ||
1123 | // case Key_R: //remove from playlist | ||
1124 | // removeSelected(); | ||
1125 | // break; | ||
1126 | // case Key_P: //play | ||
1127 | // qDebug("Play"); | ||
1128 | // playSelected(); | ||
1129 | // break; | ||
1130 | // case Key_Space: | ||
1131 | // qDebug("Play"); | ||
1132 | // playSelected(); | ||
1133 | // break; | ||
1134 | // } | ||
1135 | } | ||
1136 | |||
1075 | void PlayListWidget::doBlank() { | 1137 | void PlayListWidget::doBlank() { |
1076 | qDebug("do blanking"); | 1138 | qDebug("do blanking"); |
1077 | fd=open("/dev/fb0",O_RDWR); | 1139 | fd=open("/dev/fb0",O_RDWR); |
1078 | if (fd != -1) { | 1140 | if (fd != -1) { |
1079 | ioctl(fd,FBIOBLANK,1); | 1141 | ioctl(fd,FBIOBLANK,1); |
1080 | // close(fd); | 1142 | // close(fd); |
1081 | } | 1143 | } |
1082 | } | 1144 | } |
@@ -1091,17 +1153,82 @@ void PlayListWidget::doUnblank() { | |||
1091 | close(fd); | 1153 | close(fd); |
1092 | } | 1154 | } |
1093 | QCopEnvelope h("QPE/System", "setBacklight(int)"); | 1155 | QCopEnvelope h("QPE/System", "setBacklight(int)"); |
1094 | h <<-3;// v[1]; // -3 Force on | 1156 | h <<-3;// v[1]; // -3 Force on |
1095 | } | 1157 | } |
1096 | 1158 | ||
1097 | void PlayListWidget::readm3u(const QString &filename) { | 1159 | void PlayListWidget::readm3u(const QString &filename) { |
1098 | 1160 | ||
1161 | qDebug("playlist filename is "+filename); | ||
1162 | QFile f(filename); | ||
1163 | |||
1164 | if(f.open(IO_ReadOnly)) { | ||
1165 | QTextStream t(&f); | ||
1166 | QString s;//, first, second; | ||
1167 | int i=0; | ||
1168 | while ( !t.atEnd()) { | ||
1169 | // Lview->insertLine(t.readLine(),-1); | ||
1170 | s=t.readLine(); | ||
1171 | if(s.find("#",0,TRUE) == -1) { | ||
1172 | if(s.find(" ",0,TRUE) == -1) { // not sure if this is neede since cf uses vfat | ||
1173 | if(s.left(2) == "E:" || s.left(2) == "P:") { | ||
1174 | s=s.right(s.length()-2); | ||
1175 | DocLnk lnk( s ); | ||
1176 | QFileInfo f(s); | ||
1177 | QString name = f.baseName(); | ||
1178 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | ||
1179 | lnk.setName( name); | ||
1180 | s=s.replace( QRegExp("\\"),"/"); | ||
1181 | lnk.setFile( s); | ||
1182 | // lnk.setIcon(opieplayer/MPEGPlayer); | ||
1183 | qDebug("add "+name); | ||
1184 | d->selectedFiles->addToSelection( lnk); | ||
1185 | } else { // is url | ||
1186 | DocLnk lnk( s); | ||
1187 | QString name = s.right( s.length() - 7); | ||
1188 | // name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | ||
1189 | lnk.setName(name); | ||
1190 | lnk.setFile( s+"/"); | ||
1191 | // lnk.setFile( filename); | ||
1192 | // lnk.setComment( s+"/"); | ||
1193 | lnk.setType("audio/x-mpegurl"); | ||
1194 | // lnk.setIcon( "opieplayer/MPEGPlayer"); | ||
1195 | // qDebug("add "+s); | ||
1196 | d->selectedFiles->addToSelection( lnk); | ||
1197 | } | ||
1198 | i++; | ||
1199 | } | ||
1200 | } | ||
1201 | } | ||
1202 | } | ||
1099 | } | 1203 | } |
1100 | 1204 | ||
1101 | void PlayListWidget::writem3u(const QString &filename) { | 1205 | void PlayListWidget::writem3u(const QString &filename) { |
1102 | 1206 | ||
1103 | } | 1207 | } |
1104 | 1208 | ||
1105 | void PlayListWidget::readPls(const QString &filename) { | 1209 | void PlayListWidget::readPls(const QString &filename) { |
1106 | 1210 | ||
1211 | qDebug("playlist filename is "+filename); | ||
1212 | QFile f(filename); | ||
1213 | |||
1214 | if(f.open(IO_ReadOnly)) { | ||
1215 | QTextStream t(&f); | ||
1216 | QString s;//, first, second; | ||
1217 | int i=0; | ||
1218 | while ( !t.atEnd()) { | ||
1219 | // Lview->insertLine(t.readLine(),-1); | ||
1220 | // s=t.readLine(); | ||
1221 | // s=s.right(s.length()-2); | ||
1222 | // DocLnk lnk( s ); | ||
1223 | // QFileInfo f(s); | ||
1224 | // QString name = f.baseName(); | ||
1225 | // // name = name.left(name.length()-4); | ||
1226 | // name = name.right(name.findRev("/",0,TRUE)); | ||
1227 | // lnk.setName( name); | ||
1228 | // lnk.setFile( s); | ||
1229 | // qDebug("add "+name); | ||
1230 | // d->selectedFiles->addToSelection( lnk); | ||
1231 | } | ||
1232 | i++; | ||
1233 | } | ||
1107 | } | 1234 | } |