Skip to content

Commit

Permalink
Show bpm in library at 1dp, show zero values as dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
benis committed Feb 7, 2019
1 parent 59f4670 commit 3179882
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/library/basesqltablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ QVariant BaseSqlTableModel::data(const QModelIndex& index, int role) const {
QDateTime gmtDate = value.toDateTime();
gmtDate.setTimeSpec(Qt::UTC);
value = gmtDate.toLocalTime();
} else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM)) {
if (role == Qt::DisplayRole) {
value = value.toDouble() == 0.0
? "-" : QString("%1").arg(value.toDouble(), 0, 'f', 1);
}
} else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_BPM_LOCK)) {
value = value.toBool();
} else if (column == fieldIndex(ColumnCache::COLUMN_LIBRARYTABLE_YEAR)) {
Expand Down

0 comments on commit 3179882

Please sign in to comment.