Skip to content

Commit

Permalink
Simplify with temporary
Browse files Browse the repository at this point in the history
  • Loading branch information
ywwg committed Jun 5, 2021
1 parent 996a149 commit 18a9c52
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/library/basetracktablemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,11 @@ QVariant BaseTrackTableModel::roleValue(
VERIFY_OR_DEBUG_ASSERT(rawValue.canConvert<QDateTime>()) {
return QVariant();
}
QDateTime dt = mixxx::localDateTimeFromUtc(rawValue.toDateTime());
if (role == Qt::ToolTipRole || role == kDataExportRole) {
return mixxx::localDateTimeFromUtc(rawValue.toDateTime());
return dt;
}
return mixxx::localDateTimeFromUtc(rawValue.toDateTime()).date();
return dt.date();
case ColumnCache::COLUMN_LIBRARYTABLE_LAST_PLAYED_AT: {
QDateTime lastPlayedAt;
if (rawValue.type() == QVariant::String) {
Expand All @@ -642,10 +643,11 @@ QVariant BaseTrackTableModel::roleValue(
return QVariant();
}
DEBUG_ASSERT(lastPlayedAt.timeSpec() == Qt::UTC);
QDateTime dt = mixxx::localDateTimeFromUtc(lastPlayedAt);
if (role == Qt::ToolTipRole || role == kDataExportRole) {
return mixxx::localDateTimeFromUtc(lastPlayedAt);
return dt;
}
return mixxx::localDateTimeFromUtc(lastPlayedAt).date();
return dt.date();
}
case ColumnCache::COLUMN_LIBRARYTABLE_BPM: {
mixxx::Bpm bpm;
Expand Down

0 comments on commit 18a9c52

Please sign in to comment.