Commit 0c1a7d1f authored by Matthieu Gallien's avatar Matthieu Gallien 🎵
Browse files

in TrackMetadaModel::setData fix update of the model not being detected

update both copies of the data such that TrackMetaData::data() will
return the updated data instead of the original data
parent aeb869bf
...@@ -278,9 +278,12 @@ QVariant TrackMetadataModel::data(const QModelIndex &index, int role) const ...@@ -278,9 +278,12 @@ QVariant TrackMetadataModel::data(const QModelIndex &index, int role) const
bool TrackMetadataModel::setData(const QModelIndex &index, const QVariant &value, int role) bool TrackMetadataModel::setData(const QModelIndex &index, const QVariant &value, int role)
{ {
if (data(index, role) != value) { if (data(index, role) != value) {
mTrackData[mTrackKeys[index.row()]] = value; const auto dataType = mTrackKeys[index.row()];
emit dataChanged(index, index, QVector<int>() << role); mTrackData[dataType] = value;
mFullData[dataType] = value;
Q_EMIT dataChanged(index, index, QVector<int>() << role);
return true; return true;
} }
return false; return false;
......
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