From 39cdb7fc3f179112930ef220507777e28e5ad854 Mon Sep 17 00:00:00 2001 From: Jonas Kvinge Date: Sat, 4 Jan 2020 23:29:19 +0100 Subject: [PATCH] Add fallthrough comment where fallthrough is intended --- src/globalsearch/globalsearchmodel.cpp | 7 ++++++- src/library/librarymodel.cpp | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/globalsearch/globalsearchmodel.cpp b/src/globalsearch/globalsearchmodel.cpp index b84fd6233..5b1ba326f 100644 --- a/src/globalsearch/globalsearchmodel.cpp +++ b/src/globalsearch/globalsearchmodel.cpp @@ -145,20 +145,25 @@ QStandardItem* GlobalSearchModel::BuildContainers(const Song& s, case LibraryModel::GroupBy_Composer: display_text = s.composer(); + // fallthrough case LibraryModel::GroupBy_Performer: display_text = s.performer(); + // fallthrough case LibraryModel::GroupBy_Disc: display_text = s.disc(); + // fallthrough case LibraryModel::GroupBy_Grouping: display_text = s.grouping(); + // fallthrough case LibraryModel::GroupBy_Genre: if (display_text.isNull()) display_text = s.genre(); + // fallthrough case LibraryModel::GroupBy_Album: unique_tag = s.album_id(); if (display_text.isNull()) { display_text = s.album(); } - // fallthrough + // fallthrough case LibraryModel::GroupBy_AlbumArtist: if (display_text.isNull()) display_text = s.effective_albumartist(); display_text = LibraryModel::TextOrUnknown(display_text); diff --git a/src/library/librarymodel.cpp b/src/library/librarymodel.cpp index 3c4e3121c..53d8bd43c 100644 --- a/src/library/librarymodel.cpp +++ b/src/library/librarymodel.cpp @@ -1105,14 +1105,19 @@ LibraryItem* LibraryModel::ItemFromSong(GroupBy type, bool signal, case GroupBy_Composer: item->key = s.composer(); + // fallthrough case GroupBy_Performer: item->key = s.performer(); + // fallthrough case GroupBy_Grouping: item->key = s.grouping(); + // fallthrough case GroupBy_Genre: if (item->key.isNull()) item->key = s.genre(); + // fallthrough case GroupBy_Album: if (item->key.isNull()) item->key = s.album(); + // fallthrough case GroupBy_AlbumArtist: if (item->key.isNull()) item->key = s.effective_albumartist(); item->display_text = TextOrUnknown(item->key);