Commit c3dfad3e authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

fix files enqueue of music from NavigationActionBar (i.e. proxy model)

adding music from files view by the buttons of the NavigationActionBar
was broken. Fix it.
parent 24742a2b
...@@ -82,14 +82,16 @@ void FileBrowserProxyModel::genericEnqueueToPlayList(QModelIndex rootIndex, ...@@ -82,14 +82,16 @@ void FileBrowserProxyModel::genericEnqueueToPlayList(QModelIndex rootIndex,
{ {
QtConcurrent::run(&mThreadPool, [=] () { QtConcurrent::run(&mThreadPool, [=] () {
QReadLocker locker(&mDataLock); QReadLocker locker(&mDataLock);
auto allTrackUrls = DataTypes::EntryDataList{}; auto allData = DataTypes::EntryDataList{};
for (int rowIndex = 0, maxRowCount = rowCount(); rowIndex < maxRowCount; ++rowIndex) { for (int rowIndex = 0, maxRowCount = rowCount(); rowIndex < maxRowCount; ++rowIndex) {
auto currentIndex = index(rowIndex, 0, rootIndex); auto currentIndex = index(rowIndex, 0, rootIndex);
if (!data(currentIndex, DataTypes::IsDirectoryRole).toBool()) { if (!data(currentIndex, DataTypes::IsDirectoryRole).toBool()) {
allTrackUrls.push_back({{}, {}, data(currentIndex, DataTypes::ResourceRole).toUrl()}); allData.push_back(DataTypes::EntryData{data(currentIndex, DataTypes::FullDataRole).value<DataTypes::MusicDataType>(),
data(currentIndex, Qt::DisplayRole).toString(),
data(currentIndex, DataTypes::ResourceRole).toUrl()});
} }
} }
Q_EMIT entriesToEnqueue(allTrackUrls, enqueueMode, triggerPlay); Q_EMIT entriesToEnqueue(allData, enqueueMode, triggerPlay);
}); });
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment