author | simon <simon> | 2002-12-02 15:51:48 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-02 15:51:48 (UTC) |
commit | a0cfa5b76aac8de36304faef4bb2b14237c04c9a (patch) (unidiff) | |
tree | 0b427d07d918671065e6aed1682b108cda166ce7 /noncore/multimedia/opieplayer2/playlistwidget.cpp | |
parent | 9f770813346acbe7817b20c5fe0fea03827fc41a (diff) | |
download | opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.zip opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.tar.gz opie-a0cfa5b76aac8de36304faef4bb2b14237c04c9a.tar.bz2 |
- simplified MediaPlayer::setPlaying, moving more switch() like code into
playlistwidget
Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index fd256b7..ce73252 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -421,13 +421,13 @@ void PlayListWidget::setDocument( const QString& fileref ) { | |||
421 | 421 | ||
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() const { // this is fugly |
428 | assert( currentTab() == CurrentPlayList ); | 428 | assert( currentTab() == CurrentPlayList ); |
429 | 429 | ||
430 | // qDebug("playlist"); | 430 | // qDebug("playlist"); |
431 | if ( mediaPlayerState->isUsingPlaylist() ) { | 431 | if ( mediaPlayerState->isUsingPlaylist() ) { |
432 | return d->selectedFiles->current(); | 432 | return d->selectedFiles->current(); |
433 | } else if ( d->setDocumentUsed && d->current ) { | 433 | } else if ( d->setDocumentUsed && d->current ) { |
@@ -1138,9 +1138,19 @@ PlayListWidget::TabType PlayListWidget::currentTab() const | |||
1138 | int index = tabWidget->currentPageIndex(); | 1138 | int index = tabWidget->currentPageIndex(); |
1139 | assert( index < TabTypeCount && index >= 0 ); | 1139 | assert( index < TabTypeCount && index >= 0 ); |
1140 | 1140 | ||
1141 | return indexToTabType[ index ]; | 1141 | return indexToTabType[ index ]; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | PlayListWidget::Entry PlayListWidget::currentEntry() const | ||
1145 | { | ||
1146 | if ( currentTab() == CurrentPlayList ) { | ||
1147 | const DocLnk *lnk = current(); | ||
1148 | return Entry( lnk->name(), lnk->file() ); | ||
1149 | } | ||
1150 | |||
1151 | return Entry( currentFileListPathName() ); | ||
1152 | } | ||
1153 | |||
1144 | QString PlayListWidget::currentFileListPathName() const { | 1154 | QString PlayListWidget::currentFileListPathName() const { |
1145 | return currentFileListView()->currentItem()->text( 3 ); | 1155 | return currentFileListView()->currentItem()->text( 3 ); |
1146 | } | 1156 | } |