-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index 11a7b5c..a708cf6 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -422,27 +422,22 @@ void PlayListWidget::setDocument( const QString& fileref ) { | |||
422 | void PlayListWidget::useSelectedDocument() { | 422 | void PlayListWidget::useSelectedDocument() { |
423 | d->setDocumentUsed = FALSE; | 423 | d->setDocumentUsed = FALSE; |
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | const DocLnk *PlayListWidget::current() { // this is fugly | 427 | const DocLnk *PlayListWidget::current() { // this is fugly |
428 | switch ( whichList() ) { | 428 | assert( currentTab() == CurrentPlayList ); |
429 | case 0: //playlist | 429 | |
430 | { | ||
431 | // qDebug("playlist"); | 430 | // qDebug("playlist"); |
432 | if ( mediaPlayerState->isUsingPlaylist() ) { | 431 | if ( mediaPlayerState->isUsingPlaylist() ) { |
433 | return d->selectedFiles->current(); | 432 | return d->selectedFiles->current(); |
434 | } else if ( d->setDocumentUsed && d->current ) { | 433 | } else if ( d->setDocumentUsed && d->current ) { |
435 | return d->current; | 434 | return d->current; |
436 | } else { | 435 | } else { |
437 | return &(d->files->selectedDocument()); | 436 | return &(d->files->selectedDocument()); |
438 | } | 437 | } |
439 | } | ||
440 | break; | ||
441 | }; | ||
442 | return 0; | ||
443 | } | 438 | } |
444 | 439 | ||
445 | 440 | ||
446 | bool PlayListWidget::prev() { | 441 | bool PlayListWidget::prev() { |
447 | if ( mediaPlayerState->isUsingPlaylist() ) { | 442 | if ( mediaPlayerState->isUsingPlaylist() ) { |
448 | if ( mediaPlayerState->isShuffled() ) { | 443 | if ( mediaPlayerState->isShuffled() ) { |
@@ -1155,16 +1150,15 @@ PlayListWidget::TabType PlayListWidget::currentTab() const | |||
1155 | assert( index < NumTabTypes && index >= 0 ); | 1150 | assert( index < NumTabTypes && index >= 0 ); |
1156 | 1151 | ||
1157 | return indexToTabType[ index ]; | 1152 | return indexToTabType[ index ]; |
1158 | } | 1153 | } |
1159 | 1154 | ||
1160 | QString PlayListWidget::currentFileListPathName() const { | 1155 | QString PlayListWidget::currentFileListPathName() const { |
1161 | switch (whichList()) { | 1156 | switch (currentTab()) { |
1162 | case 1: | 1157 | case AudioFiles: |
1163 | return audioView->currentItem()->text(3); | 1158 | return audioView->currentItem()->text(3); |
1164 | break; | 1159 | case VideoFiles: |
1165 | case 2: | ||
1166 | return videoView->currentItem()->text(3); | 1160 | return videoView->currentItem()->text(3); |
1167 | break; | 1161 | default: assert( false ); |
1168 | }; | 1162 | }; |
1169 | return ""; | 1163 | return QString::null; |
1170 | } | 1164 | } |