diff options
-rw-r--r-- | playerwidget.cpp | 6 | ||||
-rw-r--r-- | playerwidget.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp index ad3d060..f0bb6cf 100644 --- a/playerwidget.cpp +++ b/playerwidget.cpp @@ -121,6 +121,7 @@ void PlayerWidget::createActions(){ QAction *removeFromPlayListA = new QAction(QIcon(":/belly_left.png"), tr("Remove from playlist"), this); connect(removeFromPlayListA, SIGNAL(triggered()), this, SLOT(removeFromPlayList())); QAction *clearPlayListA = new QAction(QIcon(":/delete.png"), tr("Clear Playlist"), this); + connect(clearPlayListA, SIGNAL(triggered()), this, SLOT(clearPlayList())); QAction *refreshA = new QAction(QIcon(":/refresh.png"), tr("Refresh..."), this); connect(refreshA, SIGNAL(triggered()), this, SLOT(reindex())); QAction *configA = Globals::instance()->action(Globals::ConfigAction); @@ -351,3 +352,8 @@ void PlayerWidget::removeFromPlayList(){ mPlayListModel->removeRow(i.row()); } } + +void PlayerWidget::clearPlayList(){ + mPlayListModel->clear(); + mPlayListModel->setHorizontalHeaderLabels(QStringList() << "Title"); +} diff --git a/playerwidget.h b/playerwidget.h index c16878e..471b223 100644 --- a/playerwidget.h +++ b/playerwidget.h @@ -28,6 +28,7 @@ class PlayerWidget : public QWidget { void reindex(); void addToPlayList(); void removeFromPlayList(); + void clearPlayList(); private: void setupGui(); |