From ebdedb20cf24ed174156aac32711eaa71fb26ef6 Mon Sep 17 00:00:00 2001 From: Arno Date: Mon, 27 Feb 2017 01:00:36 +0100 Subject: Implement clear playlist --- playerwidget.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'playerwidget.cpp') 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"); +} -- cgit v1.2.3-70-g09d2