Diffstat (limited to 'noncore/multimedia/opieplayer2/playlistwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/playlistwidget.cpp | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp index a8429e3..fd256b7 100644 --- a/noncore/multimedia/opieplayer2/playlistwidget.cpp +++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp | |||
@@ -574,11 +574,8 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
574 | d->setDocumentUsed = FALSE; | 574 | d->setDocumentUsed = FALSE; |
575 | 575 | ||
576 | if(it) { | 576 | if(it) { |
577 | switch ( whichList()) { | 577 | if ( currentTab() == CurrentPlayList ) |
578 | case 0: //playlist | 578 | return; |
579 | return; | ||
580 | break; | ||
581 | }; | ||
582 | // case 1: { | 579 | // case 1: { |
583 | DocLnk lnk; | 580 | DocLnk lnk; |
584 | QString filename; | 581 | QString filename; |
@@ -597,8 +594,8 @@ void PlayListWidget::addToSelection( QListViewItem *it) { | |||
597 | 594 | ||
598 | void PlayListWidget::tabChanged(QWidget *) { | 595 | void PlayListWidget::tabChanged(QWidget *) { |
599 | 596 | ||
600 | switch ( whichList()) { | 597 | switch ( currentTab() ) { |
601 | case 0: | 598 | case CurrentPlayList: |
602 | { | 599 | { |
603 | if( !tbDeletePlaylist->isHidden() ) { | 600 | if( !tbDeletePlaylist->isHidden() ) { |
604 | tbDeletePlaylist->hide(); | 601 | tbDeletePlaylist->hide(); |
@@ -607,7 +604,7 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
607 | d->tbAddToList->setEnabled(FALSE); | 604 | d->tbAddToList->setEnabled(FALSE); |
608 | } | 605 | } |
609 | break; | 606 | break; |
610 | case 1: | 607 | case AudioFiles: |
611 | { | 608 | { |
612 | // audioView->clear(); | 609 | // audioView->clear(); |
613 | if(!audioPopulated) populateAudioView(); | 610 | if(!audioPopulated) populateAudioView(); |
@@ -619,7 +616,7 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
619 | d->tbAddToList->setEnabled(TRUE); | 616 | d->tbAddToList->setEnabled(TRUE); |
620 | } | 617 | } |
621 | break; | 618 | break; |
622 | case 2: | 619 | case VideoFiles: |
623 | { | 620 | { |
624 | // videoView->clear(); | 621 | // videoView->clear(); |
625 | if(!videoPopulated) populateVideoView(); | 622 | if(!videoPopulated) populateVideoView(); |
@@ -630,7 +627,7 @@ void PlayListWidget::tabChanged(QWidget *) { | |||
630 | d->tbAddToList->setEnabled(TRUE); | 627 | d->tbAddToList->setEnabled(TRUE); |
631 | } | 628 | } |
632 | break; | 629 | break; |
633 | case 3: | 630 | case PlayLists: |
634 | { | 631 | { |
635 | if( tbDeletePlaylist->isHidden() ) { | 632 | if( tbDeletePlaylist->isHidden() ) { |
636 | tbDeletePlaylist->show(); | 633 | tbDeletePlaylist->show(); |
@@ -1133,17 +1130,13 @@ void PlayListWidget::skinsMenuActivated( int item ) { | |||
1133 | tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); | 1130 | tr( "You must <b>restart</b> Opieplayer<br>to see your changes." ) ); |
1134 | } | 1131 | } |
1135 | 1132 | ||
1136 | int PlayListWidget::whichList() const { | ||
1137 | return tabWidget->currentPageIndex(); | ||
1138 | } | ||
1139 | |||
1140 | PlayListWidget::TabType PlayListWidget::currentTab() const | 1133 | PlayListWidget::TabType PlayListWidget::currentTab() const |
1141 | { | 1134 | { |
1142 | static const TabType indexToTabType[ NumTabTypes ] = | 1135 | static const TabType indexToTabType[ TabTypeCount ] = |
1143 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; | 1136 | { CurrentPlayList, AudioFiles, VideoFiles, PlayLists }; |
1144 | 1137 | ||
1145 | int index = tabWidget->currentPageIndex(); | 1138 | int index = tabWidget->currentPageIndex(); |
1146 | assert( index < NumTabTypes && index >= 0 ); | 1139 | assert( index < TabTypeCount && index >= 0 ); |
1147 | 1140 | ||
1148 | return indexToTabType[ index ]; | 1141 | return indexToTabType[ index ]; |
1149 | } | 1142 | } |