summaryrefslogtreecommitdiffstats
path: root/playerwidget.cpp
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-02-17 20:36:04 +0100
committerArno <arno@disconnect.de>2018-02-17 20:36:04 +0100
commit5102619956a514a2312f7a351a1d8b5aff4f0e6d (patch)
treed8550022a42b27203a7ad826766b129a535bd713 /playerwidget.cpp
parent280c75090cb518f0f1a4e2b470a7722f95b9c9ab (diff)
downloadBeetPlayer-5102619956a514a2312f7a351a1d8b5aff4f0e6d.tar.gz
BeetPlayer-5102619956a514a2312f7a351a1d8b5aff4f0e6d.tar.bz2
BeetPlayer-5102619956a514a2312f7a351a1d8b5aff4f0e6d.zip
Re-add QActions "Add to playlist (and clear)"
Diffstat (limited to 'playerwidget.cpp')
-rw-r--r--playerwidget.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/playerwidget.cpp b/playerwidget.cpp
index 9e5d699..e01014a 100644
--- a/playerwidget.cpp
+++ b/playerwidget.cpp
@@ -155,6 +155,15 @@ void PlayerWidget::setupGui(QSplashScreen *splash){
for(QAction *a : bottomTBG->actions()){
bottomTB->addAction(a);
}
+ for(int i = 0; i < mCollectionStack->count(); ++i){
+ CollectionWidget *curW = qobject_cast<CollectionWidget*>(mCollectionStack->widget(i));
+ QAction *addToPlayListA = new QAction(QIcon(":/belly_right.png"), tr("Add to playlist"), this);
+ connect(addToPlayListA, &QAction::triggered, this, &PlayerWidget::addToPlayList);
+ curW->view()->addAction(addToPlayListA);
+ QAction *addToPlayListAndClearA = new QAction(QIcon(":/belly_right_and_clear.png"), tr("Clear and add"), this);
+ connect(addToPlayListAndClearA, &QAction::triggered, this, &PlayerWidget::addToPlayListAndClear);
+ curW->view()->addAction(addToPlayListAndClearA);
+ }
//left widget
QWidget *leftWidget = new QWidget;
@@ -529,7 +538,7 @@ void PlayerWidget::setNowPlaying(const QString &what){
}
void PlayerWidget::recurse(const QModelIndex &parent){
- const QStandardItemModel *m = qobject_cast<const QStandardItemModel*>(parent.model());
+ const QAbstractItemModel *m = parent.model();
for(int i = 0; i < m->rowCount(parent); ++i){
QModelIndex cur = m->index(i, 0, parent);
int type = cur.data(TypeRole).toInt();