summaryrefslogtreecommitdiff
authorsimon <simon>2002-12-02 14:47:45 (UTC)
committer simon <simon>2002-12-02 14:47:45 (UTC)
commit3644bde7c86013c699978446c29ec6502220e29c (patch) (side-by-side diff)
treeb3c1df324e8f3051d0b54fdb3e5e7e4904fbde4a
parent46d64cdfe9a3d949e91ea6a72828405d03337225 (diff)
downloadopie-3644bde7c86013c699978446c29ec6502220e29c.zip
opie-3644bde7c86013c699978446c29ec6502220e29c.tar.gz
opie-3644bde7c86013c699978446c29ec6502220e29c.tar.bz2
- more whichList usage removed
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp34
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 ) {
void PlayListWidget::useSelectedDocument() {
d->setDocumentUsed = FALSE;
}
const DocLnk *PlayListWidget::current() { // this is fugly
- switch ( whichList() ) {
- case 0: //playlist
- {
+ assert( currentTab() == CurrentPlayList );
+
// qDebug("playlist");
- if ( mediaPlayerState->isUsingPlaylist() ) {
- return d->selectedFiles->current();
- } else if ( d->setDocumentUsed && d->current ) {
- return d->current;
- } else {
- return &(d->files->selectedDocument());
- }
- }
- break;
- };
- return 0;
+ if ( mediaPlayerState->isUsingPlaylist() ) {
+ return d->selectedFiles->current();
+ } else if ( d->setDocumentUsed && d->current ) {
+ return d->current;
+ } else {
+ return &(d->files->selectedDocument());
+ }
}
bool PlayListWidget::prev() {
if ( mediaPlayerState->isUsingPlaylist() ) {
if ( mediaPlayerState->isShuffled() ) {
@@ -1155,16 +1150,15 @@ PlayListWidget::TabType PlayListWidget::currentTab() const
assert( index < NumTabTypes && index >= 0 );
return indexToTabType[ index ];
}
QString PlayListWidget::currentFileListPathName() const {
- switch (whichList()) {
- case 1:
+ switch (currentTab()) {
+ case AudioFiles:
return audioView->currentItem()->text(3);
- break;
- case 2:
+ case VideoFiles:
return videoView->currentItem()->text(3);
- break;
+ default: assert( false );
};
- return "";
+ return QString::null;
}