diff --git a/src/library/basesqltablemodel.cpp b/src/library/basesqltablemodel.cpp index 4d5fdaf853a4..1e674fc7f69b 100644 --- a/src/library/basesqltablemodel.cpp +++ b/src/library/basesqltablemodel.cpp @@ -821,13 +821,13 @@ void BaseSqlTableModel::tracksChanged(const QSet& trackIds) { qDebug() << this << "trackChanged" << trackIds.size(); } - const int numColumns = columnCount(); + const int lastColumn = columnCount() - 1; for (const auto& trackId : trackIds) { const auto rows = getTrackRows(trackId); for (int row : rows) { //qDebug() << "Row in this result set was updated. Signalling update. track:" << trackId << "row:" << row; QModelIndex topLeft = index(row, 0); - QModelIndex bottomRight = index(row, numColumns); + QModelIndex bottomRight = index(row, lastColumn); emit dataChanged(topLeft, bottomRight); } }