Implemente titlewidget button actions for folders
This commit is contained in:
committed by
Craig Drummond
parent
d07fc7532b
commit
9d08c2984b
@@ -73,6 +73,7 @@ FolderPage::FolderPage(QWidget *p)
|
||||
view->addAction(StdActions::self()->deleteSongsAction);
|
||||
#endif
|
||||
view->setModel(&model);
|
||||
connect(view, SIGNAL(updateToPlayQueue(QModelIndex,bool)), this, SLOT(updateToPlayQueue(QModelIndex,bool)));
|
||||
}
|
||||
|
||||
FolderPage::~FolderPage()
|
||||
@@ -149,6 +150,15 @@ void FolderPage::openFileManager()
|
||||
}
|
||||
}
|
||||
|
||||
void FolderPage::updateToPlayQueue(const QModelIndex &idx, bool replace)
|
||||
{
|
||||
BrowseModel::Item *item = static_cast<BrowseModel::Item *>(idx.internalPointer());
|
||||
if (item->isFolder()) {
|
||||
emit add(QStringList() << MPDConnection::constDirPrefix+static_cast<BrowseModel::FolderItem *>(item)->getPath(),
|
||||
replace ? MPDConnection::ReplaceAndplay : MPDConnection::Append, 0);
|
||||
}
|
||||
}
|
||||
|
||||
QList<Song> FolderPage::selectedSongs(bool allowPlaylists) const
|
||||
{
|
||||
return model.songs(view->selectedIndexes(), allowPlaylists);
|
||||
|
||||
@@ -57,6 +57,9 @@ public Q_SLOTS:
|
||||
void itemDoubleClicked(const QModelIndex &);
|
||||
void openFileManager();
|
||||
|
||||
private Q_SLOTS:
|
||||
void updateToPlayQueue(const QModelIndex &idx, bool replace);
|
||||
|
||||
private:
|
||||
void doSearch() { }
|
||||
void controlActions();
|
||||
|
||||
Reference in New Issue
Block a user