Commit 56468613 authored by Javier Goday's avatar Javier Goday Committed by Matthieu Gallien
Browse files

Allow update track rating in DataListView

parent 7fb3d070
Pipeline #71491 passed with stage
in 7 minutes and 55 seconds
......@@ -580,5 +580,9 @@ void MusicListenersManager::createTracksListener()
}
}
void MusicListenersManager::updateSingleFileMetaData(const QUrl &url, DataTypes::ColumnsRoles role, const QVariant &data)
{
tracksListener()->updateSingleFileMetaData(url, role, data);
}
#include "moc_musiclistenersmanager.cpp"
......@@ -148,6 +148,8 @@ public Q_SLOTS:
void resetMusicData();
void updateSingleFileMetaData(const QUrl &url, DataTypes::ColumnsRoles role, const QVariant &data);
private Q_SLOTS:
void configChanged();
......
......@@ -138,6 +138,10 @@ FocusScope {
isAlternateColor: (index % 2) === 1
detailedView: !viewHeader.displaySingleAlbum
onTrackRatingChanged: {
ElisaApplication.musicManager.updateSingleFileMetaData(url, DataTypes.RatingRole, rating)
}
onEnqueue: ElisaApplication.mediaPlayListProxyModel.enqueue(model.fullData, model.display,
ElisaUtils.AppendPlayList,
ElisaUtils.DoNotTriggerPlay)
......
......@@ -39,6 +39,7 @@ FocusScope {
signal enqueue()
signal replaceAndPlay()
signal callOpenMetaDataView(var url, var entryType)
signal trackRatingChanged(var url, var rating)
Accessible.role: Accessible.ListItem
Accessible.name: title
......@@ -303,12 +304,17 @@ FocusScope {
RatingStar {
id: ratingWidget
visible: !Kirigami.Settings.isMobile
readOnly: false
starRating: rating
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.leftMargin: Kirigami.Units.largeSpacing
Layout.rightMargin: Kirigami.Units.largeSpacing
onRatingEdited: {
trackRatingChanged(trackUrl, starRating);
}
}
LabelWithToolTip {
......
Supports Markdown
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