-rw-r--r-- | core/multimedia/opieplayer/playlistwidget.cpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/core/multimedia/opieplayer/playlistwidget.cpp b/core/multimedia/opieplayer/playlistwidget.cpp index 4926287..b9b63c7 100644 --- a/core/multimedia/opieplayer/playlistwidget.cpp +++ b/core/multimedia/opieplayer/playlistwidget.cpp | |||
@@ -1144,30 +1144,41 @@ void PlayListWidget::keyReleaseEvent( QKeyEvent *e) | |||
1144 | // playSelected(); | 1144 | // playSelected(); |
1145 | // break; | 1145 | // break; |
1146 | case Key_Space: | 1146 | case Key_Space: |
1147 | qDebug("Play"); | 1147 | qDebug("Play"); |
1148 | // playSelected(); puh | 1148 | // playSelected(); puh |
1149 | break; | 1149 | break; |
1150 | case Key_1: | 1150 | case Key_1: |
1151 | tabWidget->setCurrentPage(0); | 1151 | tabWidget->setCurrentPage(0); |
1152 | break; | 1152 | break; |
1153 | case Key_2: | 1153 | case Key_2: |
1154 | tabWidget->setCurrentPage(1); | 1154 | tabWidget->setCurrentPage(1); |
1155 | break; | 1155 | break; |
1156 | case Key_3: | 1156 | case Key_3: |
1157 | tabWidget->setCurrentPage(2); | 1157 | tabWidget->setCurrentPage(2); |
1158 | break; | 1158 | break; |
1159 | case Key_4: | 1159 | case Key_4: |
1160 | tabWidget->setCurrentPage(3); | 1160 | tabWidget->setCurrentPage(3); |
1161 | break; | 1161 | break; |
1162 | case Key_Down: | ||
1163 | if ( !d->selectedFiles->next() ) | ||
1164 | d->selectedFiles->first(); | ||
1165 | |||
1166 | break; | ||
1167 | case Key_Up: | ||
1168 | if ( !d->selectedFiles->prev() ) | ||
1169 | d->selectedFiles->last(); | ||
1170 | |||
1171 | break; | ||
1172 | |||
1162 | } | 1173 | } |
1163 | } | 1174 | } |
1164 | 1175 | ||
1165 | void PlayListWidget::keyPressEvent( QKeyEvent *e) | 1176 | void PlayListWidget::keyPressEvent( QKeyEvent *e) |
1166 | { | 1177 | { |
1167 | // qDebug("Key press"); | 1178 | // qDebug("Key press"); |
1168 | // switch ( e->key() ) { | 1179 | // switch ( e->key() ) { |
1169 | // ////////////////////////////// Zaurus keys | 1180 | // ////////////////////////////// Zaurus keys |
1170 | // case Key_A: //add to playlist | 1181 | // case Key_A: //add to playlist |
1171 | // qDebug("Add"); | 1182 | // qDebug("Add"); |
1172 | // addSelected(); | 1183 | // addSelected(); |
1173 | // break; | 1184 | // break; |
@@ -1327,31 +1338,29 @@ void PlayListWidget::readPls(const QString &filename) { | |||
1327 | QFileInfo f(s); | 1338 | QFileInfo f(s); |
1328 | QString name = f.baseName(); | 1339 | QString name = f.baseName(); |
1329 | if(name.left(4)=="http") | 1340 | if(name.left(4)=="http") |
1330 | name = s.right( s.length() - 7); | 1341 | name = s.right( s.length() - 7); |
1331 | else | 1342 | else |
1332 | name=s; | 1343 | name=s; |
1333 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); | 1344 | name = name.right(name.length()-name.findRev("\\",-1,TRUE)-1); |
1334 | // QFileInfo f(s); | 1345 | // QFileInfo f(s); |
1335 | // QString name = f.baseName(); | 1346 | // QString name = f.baseName(); |
1336 | // name = name.left(name.length()-4); | 1347 | // name = name.left(name.length()-4); |
1337 | // name = name.right(name.findRev("/",0,TRUE)); | 1348 | // name = name.right(name.findRev("/",0,TRUE)); |
1338 | lnk.setName( name); | 1349 | lnk.setName( name); |
1339 | if(s.at(s.length()-4) == '.') | 1350 | if(s.at(s.length()-4) == '.') // if this is probably a file |
1340 | lnk.setFile( s); | 1351 | lnk.setFile( s); |
1341 | else { | 1352 | else { //if its a url |
1342 | if( name.right(1).find('/') == -1) | 1353 | if( name.right(1).find('/') == -1) |
1343 | s+="/"; | 1354 | s+="/"; |
1344 | // if(s.right(1) != '/') | 1355 | lnk.setFile( s); |
1345 | lnk.setFile( s); | ||
1346 | |||
1347 | } | 1356 | } |
1348 | lnk.setType("audio/x-mpegurl"); | 1357 | lnk.setType("audio/x-mpegurl"); |
1349 | 1358 | ||
1350 | qDebug("DocLnk add "+name); | 1359 | qDebug("DocLnk add "+name); |
1351 | d->selectedFiles->addToSelection( lnk); | 1360 | d->selectedFiles->addToSelection( lnk); |
1352 | } | 1361 | } |
1353 | } | 1362 | } |
1354 | i++; | 1363 | i++; |
1355 | } | 1364 | } |
1356 | } | 1365 | } |
1357 | 1366 | ||