summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Schürmann <daschuer@mixxx.org>2021-02-24 00:27:52 +0100
committerDaniel Schürmann <daschuer@mixxx.org>2021-02-24 00:27:52 +0100
commitd093a52276c2ebff2e3becb3db47f0024aedc15d (patch)
tree3641082c968b1ec4857e903da4e87db461f0a6b5
parent473059141f6e64ad0bcc55e56dbca1d8004482c3 (diff)
Restore the Solution with the case fallthrough
-rw-r--r--src/library/basetracktablemodel.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/src/library/basetracktablemodel.cpp b/src/library/basetracktablemodel.cpp
index f991f1d9bb..977a73f650 100644
--- a/src/library/basetracktablemodel.cpp
+++ b/src/library/basetracktablemodel.cpp
@@ -548,9 +548,21 @@ QVariant BaseTrackTableModel::roleValue(
}
switch (role) {
case Qt::ToolTipRole:
- case Qt::DisplayRole:
case kDataExportRole:
switch (field) {
+ case ColumnCache::COLUMN_LIBRARYTABLE_COLOR:
+ return mixxx::RgbColor::toQString(mixxx::RgbColor::fromQVariant(rawValue));
+ case ColumnCache::COLUMN_LIBRARYTABLE_COVERART:
+ return composeCoverArtToolTipHtml(index);
+ case ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW:
+ return QVariant();
+ default:
+ // Same value as for Qt::DisplayRole (see below)
+ break;
+ }
+ M_FALLTHROUGH_INTENDED;
+ case Qt::DisplayRole:
+ switch (field) {
case ColumnCache::COLUMN_LIBRARYTABLE_DURATION: {
if (rawValue.isNull()) {
return QVariant();
@@ -735,24 +747,6 @@ QVariant BaseTrackTableModel::roleValue(
// Not yet supported
DEBUG_ASSERT(rawValue.isNull());
break;
- case ColumnCache::COLUMN_LIBRARYTABLE_COLOR:
- if (role == Qt::ToolTipRole || role == kDataExportRole) {
- return mixxx::RgbColor::toQString(mixxx::RgbColor::fromQVariant(rawValue));
- }
- // Otherwise, just use the column value
- break;
- case ColumnCache::COLUMN_LIBRARYTABLE_COVERART:
- if (role == Qt::ToolTipRole || role == kDataExportRole) {
- return composeCoverArtToolTipHtml(index);
- }
- // Otherwise, just use the column value
- break;
- case ColumnCache::COLUMN_LIBRARYTABLE_PREVIEW:
- if (role == Qt::ToolTipRole || role == kDataExportRole) {
- return QVariant();
- }
- // Otherwise, just use the column value
- break;
default:
// Otherwise, just use the column value
break;