summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -47,2 +47,4 @@ public slots:
+ bool isEmpty() const { return childCount() == 0; }
+
protected:
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
@@ -420,3 +420,9 @@ const DocLnk *PlayListWidget::current() const { // this is fugly
- return d->selectedFiles->current();
+ const DocLnk *lnk = d->selectedFiles->current();
+ if ( !lnk ) {
+ d->selectedFiles->first();
+ lnk = d->selectedFiles->current();
+ }
+ assert( lnk );
+ return lnk;
}
@@ -566,2 +572,4 @@ void PlayListWidget::tabChanged(QWidget *) {
d->tbAddToList->setEnabled(FALSE);
+
+ d->tbPlay->setEnabled( !d->selectedFiles->isEmpty() );
}