summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/playlistselection.h2
-rw-r--r--noncore/multimedia/opieplayer2/playlistwidget.cpp10
2 files changed, 11 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/playlistselection.h b/noncore/multimedia/opieplayer2/playlistselection.h
index d10bc82..9cc4e30 100644
--- a/noncore/multimedia/opieplayer2/playlistselection.h
+++ b/noncore/multimedia/opieplayer2/playlistselection.h
@@ -45,6 +45,8 @@ public slots:
45 bool first(); 45 bool first();
46 bool last(); 46 bool last();
47 47
48 bool isEmpty() const { return childCount() == 0; }
49
48protected: 50protected:
49 virtual void contentsMouseMoveEvent(QMouseEvent *); 51 virtual void contentsMouseMoveEvent(QMouseEvent *);
50/* #ifdef USE_PLAYLIST_BACKGROUND */ 52/* #ifdef USE_PLAYLIST_BACKGROUND */
diff --git a/noncore/multimedia/opieplayer2/playlistwidget.cpp b/noncore/multimedia/opieplayer2/playlistwidget.cpp
index f53def6..b08204e 100644
--- a/noncore/multimedia/opieplayer2/playlistwidget.cpp
+++ b/noncore/multimedia/opieplayer2/playlistwidget.cpp
@@ -418,7 +418,13 @@ void PlayListWidget::useSelectedDocument() {
418const DocLnk *PlayListWidget::current() const { // this is fugly 418const DocLnk *PlayListWidget::current() const { // this is fugly
419 assert( currentTab() == CurrentPlayList ); 419 assert( currentTab() == CurrentPlayList );
420 420
421 return d->selectedFiles->current(); 421 const DocLnk *lnk = d->selectedFiles->current();
422 if ( !lnk ) {
423 d->selectedFiles->first();
424 lnk = d->selectedFiles->current();
425 }
426 assert( lnk );
427 return lnk;
422} 428}
423 429
424 430
@@ -564,6 +570,8 @@ void PlayListWidget::tabChanged(QWidget *) {
564 } 570 }
565 d->tbRemoveFromList->setEnabled(TRUE); 571 d->tbRemoveFromList->setEnabled(TRUE);
566 d->tbAddToList->setEnabled(FALSE); 572 d->tbAddToList->setEnabled(FALSE);
573
574 d->tbPlay->setEnabled( !d->selectedFiles->isEmpty() );
567 } 575 }
568 break; 576 break;
569 case AudioFiles: 577 case AudioFiles: