Skip to content

Commit

Permalink
Merge pull request #13769 from JoergAtGithub/FixClazy12errors_2.5
Browse files Browse the repository at this point in the history
Fix Clazy v1.12 errors in 2.5
  • Loading branch information
daschuer authored Oct 14, 2024
2 parents bac0ca1 + d2faf1d commit c14bd80
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
"position as loop end") +
noBeatsSeconds;

QList<double> beatSizes = LoopingControl::getBeatSizes();
const QList<double> beatSizes = LoopingControl::getBeatSizes();

QMap<double, QString> humanBeatSizes;
humanBeatSizes[0.03125] = tr("1/32");
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/legacycontrollermapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void LegacyControllerMapping::loadSettings(UserSettingsPointer pConfig,
.arg(controllerName, controllerPath);

auto availableSettings = getSettings();
QList<ConfigKey> definedSettings = pConfig->getKeysWithGroup(controllerKey);
const QList<ConfigKey> definedSettings = pConfig->getKeysWithGroup(controllerKey);

QList<QString> availableSettingKeys;
for (const auto& pSetting : std::as_const(availableSettings)) {
Expand Down
12 changes: 6 additions & 6 deletions src/library/dlgtrackinfomulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ void DlgTrackInfoMulti::updateFromTracks() {
// If track value differs from the current value, add it to the list.
// If new and current are identical, keep only one.
int commonRating = m_trackRecords.first().getRating();
for (const auto& rec : m_trackRecords) {
for (const auto& rec : std::as_const(m_trackRecords)) {
if (commonRating != rec.getRating()) {
commonRating = 0;
break;
Expand All @@ -319,7 +319,7 @@ void DlgTrackInfoMulti::updateFromTracks() {
// Same procedure for the track color
mixxx::RgbColor::optional_t commonColor = m_trackRecords.first().getColor();
bool multipleColors = false;
for (const auto& rec : m_trackRecords) {
for (const auto& rec : std::as_const(m_trackRecords)) {
if (commonColor != rec.getColor()) {
commonColor = mixxx::RgbColor::nullopt();
multipleColors = true;
Expand Down Expand Up @@ -377,7 +377,7 @@ void DlgTrackInfoMulti::updateTrackMetadataFields() {
QSet<uint32_t> samplerates;
QSet<QString> filetypes;

for (const auto& rec : m_trackRecords) {
for (const auto& rec : std::as_const(m_trackRecords)) {
titles.insert(rec.getMetadata().getTrackInfo().getTitle());
artists.insert(rec.getMetadata().getTrackInfo().getArtist());
aTitles.insert(rec.getMetadata().getAlbumInfo().getTitle());
Expand Down Expand Up @@ -651,7 +651,7 @@ void DlgTrackInfoMulti::saveTracks() {
// and repopulate all these fields.
disconnectTracksChanged();
// Update the cached tracks
for (const auto& rec : m_trackRecords) {
for (const auto& rec : std::as_const(m_trackRecords)) {
auto pTrack = m_pLoadedTracks.value(rec.getId());
// If replaceRecord() returns true then both m_trackRecord and m_pBeatsClone
// will be updated by the subsequent Track::changed() signal to keep them
Expand Down Expand Up @@ -813,7 +813,7 @@ void DlgTrackInfoMulti::slotKeyTextChanged() {
newKeyText = KeyUtils::keyToString(newKey);
} else if (newTextInput.isEmpty()) {
// Empty text is not a valid key but indicates we want to clear the key.
newKeyText = QStringLiteral("");
newKeyText = QString();
}

txtKey->blockSignals(true);
Expand Down Expand Up @@ -897,7 +897,7 @@ void DlgTrackInfoMulti::updateCoverArtFromTracks() {
return;
}
CoverInfoRelative refCover = m_trackRecords.first().getCoverInfo();
for (const auto& rec : m_trackRecords) {
for (const auto& rec : std::as_const(m_trackRecords)) {
if (rec.getCoverInfo() != refCover) {
refCover.reset();
break;
Expand Down
2 changes: 1 addition & 1 deletion src/library/searchqueryparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ std::unique_ptr<AndNode> SearchQueryParser::parseAndNode(const QString& query) c
std::unique_ptr<OrNode> SearchQueryParser::parseOrNode(const QString& query) const {
auto pQuery = std::make_unique<OrNode>();

QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp,
const QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp,
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts);
#else
Expand Down
3 changes: 2 additions & 1 deletion src/qml/qmlplayerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ void QmlPlayerProxy::slotHotcuesChanged() {

const TrackPointer pTrack = m_pCurrentTrack;
if (pTrack) {
for (const auto& cuePoint : pTrack->getCuePoints()) {
const auto& cuePoints = pTrack->getCuePoints();
for (const auto& cuePoint : cuePoints) {
if (cuePoint->getHotCue() == Cue::kNoHotCue)
continue;
hotcues.append(cuePoint);
Expand Down
2 changes: 1 addition & 1 deletion src/widget/wtracktableview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ QModelIndexList WTrackTableView::getSelectedRows() const {
}

QList<int> WTrackTableView::getSelectedRowNumbers() const {
QModelIndexList indices = getSelectedRows();
const QModelIndexList indices = getSelectedRows();
QList<int> selectedRows;
for (const QModelIndex& idx : indices) {
selectedRows.append(idx.row());
Expand Down

0 comments on commit c14bd80

Please sign in to comment.