summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp23
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.h4
2 files changed, 10 insertions, 17 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
@@ -575,9 +575,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
if(it) {
- switch ( whichList()) {
- case 0: //playlist
+ if ( currentTab() == CurrentPlayList )
return;
- break;
- };
// case 1: {
DocLnk lnk;
@@ -598,6 +595,6 @@ void PlayListWidget::addToSelection( QListViewItem *it) {
void PlayListWidget::tabChanged(QWidget *) {
- switch ( whichList()) {
- case 0:
+ switch ( currentTab() ) {
+ case CurrentPlayList:
{
if( !tbDeletePlaylist->isHidden() ) {
@@ -608,5 +605,5 @@ void PlayListWidget::tabChanged(QWidget *) {
}
break;
- case 1:
+ case AudioFiles:
{
// audioView->clear();
@@ -620,5 +617,5 @@ void PlayListWidget::tabChanged(QWidget *) {
}
break;
- case 2:
+ case VideoFiles:
{
// videoView->clear();
@@ -631,5 +628,5 @@ void PlayListWidget::tabChanged(QWidget *) {
}
break;
- case 3:
+ case PlayLists:
{
if( tbDeletePlaylist->isHidden() ) {
@@ -1134,15 +1131,11 @@ void PlayListWidget::skinsMenuActivated( int item ) {
}
-int PlayListWidget::whichList() const {
- return tabWidget->currentPageIndex();
-}
-
PlayListWidget::TabType PlayListWidget::currentTab() const
{
- static const TabType indexToTabType[ NumTabTypes ] =
+ static const TabType indexToTabType[ TabTypeCount ] =
{ CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
int index = tabWidget->currentPageIndex();
- assert( index < NumTabTypes && index >= 0 );
+ assert( index < TabTypeCount && index >= 0 );
return indexToTabType[ index ];
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.h b/noncore/multimedia/opieplayer2/playlistwidget.h
index 238a75c..2e2ff89 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.h
+++ b/noncore/multimedia/opieplayer2/playlistwidget.h
@@ -56,5 +56,6 @@ class PlayListWidget : public PlayListWidgetGui {
Q_OBJECT
public:
- enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists, NumTabTypes = 4 };
+ enum TabType { CurrentPlayList, AudioFiles, VideoFiles, PlayLists };
+ enum { TabTypeCount = 4 };
PlayListWidget( QWidget* parent=0, const char* name=0, WFlags fl=0 );
@@ -69,5 +70,4 @@ public:
void useSelectedDocument();
int selected;
- int whichList() const;
TabType currentTab() const;