From b6f975e52c65623e3d700e9ea29b4fd0f34079cb Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 8 Oct 2024 23:22:22 +0200 Subject: [PATCH 01/14] (fix) Overview waveform: add tooltip info about left-click dragging --- src/skin/legacy/tooltips.cpp | 2 ++ src/widget/woverview.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/src/skin/legacy/tooltips.cpp b/src/skin/legacy/tooltips.cpp index 6b33e48d4a01..f6cd8dd98be4 100644 --- a/src/skin/legacy/tooltips.cpp +++ b/src/skin/legacy/tooltips.cpp @@ -47,6 +47,8 @@ void Tooltips::addStandardTooltips() { << tr("Waveform Overview") << tr("Shows information about the track currently loaded in this deck.") << "\n" << tr("Left click to jump around in the track.") + << tr("Left click and hold allows to preview the position where the play head " + "will jump to on release. Dragging can be aborted with right click.") << tr("Right click hotcues to edit their labels and colors.") << tr("Right click anywhere else to show the time at that point.") << dropTracksHere; diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 6fa681aea3ea..446d56da6d1b 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -523,6 +523,7 @@ void WOverview::mousePressEvent(QMouseEvent* e) { } } else if (e->button() == Qt::RightButton) { if (m_bLeftClickDragging) { + // Abort dragging m_iPickupPos = m_iPlayPos; m_bLeftClickDragging = false; m_bTimeRulerActive = false; From f31f7dda71f805059b11d446910598b582b9fa7b Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 12 Oct 2024 12:38:23 +0200 Subject: [PATCH 02/14] Fix "signal arguments need to be fully-qualified [-Wclazy-fully-qualified-moc-types]" errors --- src/musicbrainz/web/coverartarchiveimagetask.h | 2 +- src/musicbrainz/web/musicbrainzrecordingstask.h | 4 ++-- src/network/jsonwebtask.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/musicbrainz/web/coverartarchiveimagetask.h b/src/musicbrainz/web/coverartarchiveimagetask.h index 779630639970..01bfb3f8042d 100644 --- a/src/musicbrainz/web/coverartarchiveimagetask.h +++ b/src/musicbrainz/web/coverartarchiveimagetask.h @@ -22,7 +22,7 @@ class CoverArtArchiveImageTask : public network::WebTask { const QByteArray& coverArtImageBytes); void failed( - const network::WebResponse& response, + const mixxx::network::WebResponse& response, int errorCode, const QString& errorMessage); diff --git a/src/musicbrainz/web/musicbrainzrecordingstask.h b/src/musicbrainz/web/musicbrainzrecordingstask.h index 64116408dd83..da7f61ccf33c 100644 --- a/src/musicbrainz/web/musicbrainzrecordingstask.h +++ b/src/musicbrainz/web/musicbrainzrecordingstask.h @@ -24,9 +24,9 @@ class MusicBrainzRecordingsTask : public network::WebTask { signals: void succeeded( - const QList& trackReleases); + const QList& trackReleases); void failed( - const network::WebResponse& response, + const mixxx::network::WebResponse& response, int errorCode, const QString& errorMessage); void currentRecordingFetchedFromMusicBrainz(); diff --git a/src/network/jsonwebtask.h b/src/network/jsonwebtask.h index 0b83c3e8d60e..ac171df364e5 100644 --- a/src/network/jsonwebtask.h +++ b/src/network/jsonwebtask.h @@ -78,7 +78,7 @@ class JsonWebTask : public WebTask { signals: void failed( - const network::JsonWebResponse& response); + const mixxx::network::JsonWebResponse& response); protected: // Customizable in derived classes From 64e6a24a88169c3ef1537cf07d6e35105d5a1881 Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 12 Oct 2024 09:36:10 +0200 Subject: [PATCH 03/14] Fix "c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]" errors --- src/broadcast/broadcastmanager.cpp | 18 +++++++++--------- src/controllers/controllermanager.cpp | 2 +- src/controllers/dlgprefcontroller.cpp | 2 +- src/controllers/dlgprefcontrollers.cpp | 4 ++-- .../legacymidicontrollermappingfilehandler.cpp | 4 ++-- src/dialog/dlgreplacecuecolor.cpp | 2 +- src/effects/effectslot.cpp | 4 ++-- src/effects/presets/effectpreset.cpp | 6 ++++-- src/library/banshee/bansheefeature.cpp | 2 +- src/library/dao/trackdao.cpp | 2 +- src/library/trackcollection.cpp | 2 +- src/library/trackset/baseplaylistfeature.cpp | 2 +- src/library/trackset/crate/cratefeature.cpp | 2 +- src/preferences/broadcastsettings.cpp | 2 +- src/preferences/colorpaletteeditor.cpp | 2 +- src/soundio/sounddevicenetwork.cpp | 2 +- src/soundio/soundmanager.cpp | 2 +- src/soundio/soundmanagerconfig.cpp | 10 +++++----- src/test/seratobeatgridtest.cpp | 2 +- src/test/seratomarkers2test.cpp | 2 +- src/test/seratomarkerstest.cpp | 2 +- src/waveform/renderers/waveformmark.cpp | 2 +- .../renderers/waveformrendermarkbase.cpp | 2 +- src/widget/weffectchainpresetbutton.cpp | 9 +++++---- src/widget/whotcuebutton.cpp | 2 +- src/widget/woverview.cpp | 2 +- src/widget/wsplitter.cpp | 4 ++-- src/widget/wtrackmenu.cpp | 2 +- 28 files changed, 51 insertions(+), 48 deletions(-) diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp index ea334d9ebce9..847dd4573e8f 100644 --- a/src/broadcast/broadcastmanager.cpp +++ b/src/broadcast/broadcastmanager.cpp @@ -43,7 +43,7 @@ BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager, // Initialize connections list from the current state of BroadcastSettings QList profiles = m_pBroadcastSettings->profiles(); - for (const BroadcastProfilePtr& profile : profiles) { + for (const BroadcastProfilePtr& profile : std::as_const(profiles)) { addConnection(profile); } @@ -98,7 +98,7 @@ void BroadcastManager::slotControlEnabled(double v) { if (v > 0.0) { bool atLeastOneEnabled = false; QList profiles = m_pBroadcastSettings->profiles(); - for (const BroadcastProfilePtr& profile : profiles) { + for (const BroadcastProfilePtr& profile : std::as_const(profiles)) { if (profile->getEnabled()) { atLeastOneEnabled = true; break; @@ -118,10 +118,10 @@ void BroadcastManager::slotControlEnabled(double v) { m_pBroadcastEnabled->set(false); m_pStatusCO->forceSet(STATUSCO_UNCONNECTED); QList profiles = m_pBroadcastSettings->profiles(); - for(BroadcastProfilePtr profile : profiles) { - if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) { - profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED); - } + for (BroadcastProfilePtr profile : std::as_const(profiles)) { + if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) { + profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED); + } } } @@ -138,7 +138,7 @@ void BroadcastManager::slotProfileRemoved(BroadcastProfilePtr profile) { void BroadcastManager::slotProfilesChanged() { QVector workers = m_pNetworkStream->outputWorkers(); - for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { + for (const NetworkOutputStreamWorkerPtr& pWorker : std::as_const(workers)) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection) { BroadcastProfilePtr profile = connection->profile(); @@ -199,7 +199,7 @@ bool BroadcastManager::removeConnection(BroadcastProfilePtr profile) { ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePtr profile) { QVector workers = m_pNetworkStream->outputWorkers(); - for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { + for (const NetworkOutputStreamWorkerPtr& pWorker : std::as_const(workers)) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection.isNull()) { continue; @@ -220,7 +220,7 @@ void BroadcastManager::slotConnectionStatusChanged(int newState) { // Collect status info QList profiles = m_pBroadcastSettings->profiles(); - for (BroadcastProfilePtr profile : profiles) { + for (BroadcastProfilePtr profile : std::as_const(profiles)) { if (!profile->getEnabled()) { continue; } diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp index 971c9dc634b9..8e0620da431f 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -240,7 +240,7 @@ void ControllerManager::slotSetUpDevices() { QList deviceList = getControllerList(false, true); QStringList mappingPaths(getMappingPaths(m_pConfig)); - for (Controller* pController : deviceList) { + for (Controller* pController : std::as_const(deviceList)) { QString name = pController->getName(); if (pController->isOpen()) { diff --git a/src/controllers/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index 22cdf2e165a5..7135564d58fc 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -483,7 +483,7 @@ MappingInfo DlgPrefController::enumerateMappingsFromEnumerator( pMappingEnumerator->getMappingsByExtension( m_pController->mappingExtension()); - for (const MappingInfo& mapping : systemMappings) { + for (const MappingInfo& mapping : std::as_const(systemMappings)) { m_ui.comboBoxMapping->addItem( icon, mapping.getName(), mapping.getPath()); if (m_pController->matchMapping(mapping)) { diff --git a/src/controllers/dlgprefcontrollers.cpp b/src/controllers/dlgprefcontrollers.cpp index 43b349d07f5a..21f2eeedaa45 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -146,7 +146,7 @@ void DlgPrefControllers::destroyControllerWidgets() { // to keep this dialog and the controllermanager consistent. QList controllerList = m_pControllerManager->getControllerList(false, true); - for (auto* pController : controllerList) { + for (auto* pController : std::as_const(controllerList)) { pController->disconnect(this); } while (!m_controllerPages.isEmpty()) { @@ -176,7 +176,7 @@ void DlgPrefControllers::setupControllerWidgets() { std::sort(controllerList.begin(), controllerList.end(), controllerCompare); - for (auto* pController : controllerList) { + for (auto* pController : std::as_const(controllerList)) { DlgPrefController* pControllerDlg = new DlgPrefController( this, pController, m_pControllerManager, m_pConfig); connect(pControllerDlg, diff --git a/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp b/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp index 8843bc0ece39..15927a08241a 100644 --- a/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp +++ b/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp @@ -240,7 +240,7 @@ void LegacyMidiControllerMappingFileHandler::addControlsToDocument( // to remove duplicate keys or else we'll duplicate those values. auto sortedInputKeys = mapping.getInputMappings().uniqueKeys(); std::sort(sortedInputKeys.begin(), sortedInputKeys.end()); - for (const auto& key : sortedInputKeys) { + for (const auto& key : std::as_const(sortedInputKeys)) { for (auto it = mapping.getInputMappings().constFind(key); it != mapping.getInputMappings().constEnd() && it.key() == key; ++it) { @@ -254,7 +254,7 @@ void LegacyMidiControllerMappingFileHandler::addControlsToDocument( QDomElement outputs = doc->createElement("outputs"); auto sortedOutputKeys = mapping.getOutputMappings().uniqueKeys(); std::sort(sortedOutputKeys.begin(), sortedOutputKeys.end()); - for (const auto& key : sortedOutputKeys) { + for (const auto& key : std::as_const(sortedOutputKeys)) { for (auto it = mapping.getOutputMappings().constFind(key); it != mapping.getOutputMappings().constEnd() && it.key() == key; ++it) { diff --git a/src/dialog/dlgreplacecuecolor.cpp b/src/dialog/dlgreplacecuecolor.cpp index 3e34477e8c59..7b6c7a5a63ed 100644 --- a/src/dialog/dlgreplacecuecolor.cpp +++ b/src/dialog/dlgreplacecuecolor.cpp @@ -311,7 +311,7 @@ void DlgReplaceCueColor::slotApply() { // Flush cached tracks to database QSet cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds(); - for (const TrackId& trackId : cachedTrackIds) { + for (const TrackId& trackId : std::as_const(cachedTrackIds)) { TrackPointer pTrack = GlobalTrackCacheLocker().lookupTrackById(trackId); if (pTrack) { m_pTrackCollectionManager->saveTrack(pTrack); diff --git a/src/effects/effectslot.cpp b/src/effects/effectslot.cpp index 639c4f1a6513..43431ece5084 100644 --- a/src/effects/effectslot.cpp +++ b/src/effects/effectslot.cpp @@ -332,8 +332,8 @@ void EffectSlot::loadEffectInner(const EffectManifestPointer pManifest, continue; } - for (const auto& pParameter : - m_allParameters.value(parameterType)) { + const auto& allParameters = m_allParameters.value(parameterType); + for (const auto& pParameter : allParameters) { if (pParameter->manifest()->id() == parameterPreset.id()) { m_loadedParameters[parameterType].append(pParameter); break; diff --git a/src/effects/presets/effectpreset.cpp b/src/effects/presets/effectpreset.cpp index b3e087d9bcc2..5f7918d94c58 100644 --- a/src/effects/presets/effectpreset.cpp +++ b/src/effects/presets/effectpreset.cpp @@ -53,10 +53,12 @@ EffectPreset::EffectPreset(const EffectSlotPointer pEffectSlot) for (int parameterTypeId = 0; parameterTypeId < numTypes; ++parameterTypeId) { const EffectParameterType parameterType = static_cast(parameterTypeId); - for (const auto& pParameter : pEffectSlot->getLoadedParameters().value(parameterType)) { + const auto& loadedParameters = pEffectSlot->getLoadedParameters().value(parameterType); + for (const auto& pParameter : loadedParameters) { m_effectParameterPresets.append(EffectParameterPreset(pParameter, false)); } - for (const auto& pParameter : pEffectSlot->getHiddenParameters().value(parameterType)) { + const auto& hiddenParameters = pEffectSlot->getHiddenParameters().value(parameterType); + for (const auto& pParameter : hiddenParameters) { m_effectParameterPresets.append(EffectParameterPreset(pParameter, true)); } } diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp index 71f01260192a..967cca982b40 100644 --- a/src/library/banshee/bansheefeature.cpp +++ b/src/library/banshee/bansheefeature.cpp @@ -91,7 +91,7 @@ void BansheeFeature::activate() { std::unique_ptr pRootItem = TreeItem::newRoot(this); QList playlists = m_connection.getPlaylists(); - for (const BansheeDbConnection::Playlist& playlist: playlists) { + for (const BansheeDbConnection::Playlist& playlist : std::as_const(playlists)) { qDebug() << playlist.name; // append the playlist to the child model pRootItem->appendChild(playlist.name, playlist.playlistId); diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 32b3206d623d..8609833c8e45 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -132,7 +132,7 @@ void TrackDAO::finish() { // And mark the corresponding tracks in track_locations in the deleted // directories as deleted. // TODO(XXX) This doesn't handle sub-directories of deleted directories. - for (const auto& dir: deletedHashDirs) { + for (const auto& dir : std::as_const(deletedHashDirs)) { markTrackLocationsAsDeleted(m_database, dir); } transaction.commit(); diff --git a/src/library/trackcollection.cpp b/src/library/trackcollection.cpp index 3991c6711b12..db39c08c0e66 100644 --- a/src/library/trackcollection.cpp +++ b/src/library/trackcollection.cpp @@ -394,7 +394,7 @@ bool TrackCollection::purgeAllTracks( QList trackRefs = m_trackDao.getAllTrackRefs(rootDir); QList trackIds; trackIds.reserve(trackRefs.size()); - for (const auto& trackRef : trackRefs) { + for (const auto& trackRef : std::as_const(trackRefs)) { DEBUG_ASSERT(trackRef.hasId()); trackIds.append(trackRef.getId()); } diff --git a/src/library/trackset/baseplaylistfeature.cpp b/src/library/trackset/baseplaylistfeature.cpp index 21c7c1b236cf..2a155614e531 100644 --- a/src/library/trackset/baseplaylistfeature.cpp +++ b/src/library/trackset/baseplaylistfeature.cpp @@ -679,7 +679,7 @@ void BasePlaylistFeature::slotAnalyzePlaylist() { if (playlistId >= 0) { QList ids = m_playlistDao.getTrackIds(playlistId); QList tracks; - for (auto id : ids) { + for (auto id : std::as_const(ids)) { tracks.append(id); } emit analyzeTracks(tracks); diff --git a/src/library/trackset/crate/cratefeature.cpp b/src/library/trackset/crate/cratefeature.cpp index d31764bcfc4d..c4c205fff884 100644 --- a/src/library/trackset/crate/cratefeature.cpp +++ b/src/library/trackset/crate/cratefeature.cpp @@ -707,7 +707,7 @@ void CrateFeature::slotCreateImportCrate() { CrateId lastCrateId; // For each selected file create a new crate - for (const QString& playlistFile : playlistFiles) { + for (const QString& playlistFile : std::as_const(playlistFiles)) { const QFileInfo fileInfo(playlistFile); Crate crate; diff --git a/src/preferences/broadcastsettings.cpp b/src/preferences/broadcastsettings.cpp index 3c0dded503e2..f581530863d5 100644 --- a/src/preferences/broadcastsettings.cpp +++ b/src/preferences/broadcastsettings.cpp @@ -49,7 +49,7 @@ void BroadcastSettings::loadProfiles() { kLogger.info() << "Found" << files.size() << "profile(s)"; // Load profiles from filesystem - for (const QFileInfo& fileInfo : files) { + for (const QFileInfo& fileInfo : std::as_const(files)) { BroadcastProfilePtr profile = BroadcastProfile::loadFromFile(fileInfo.absoluteFilePath()); diff --git a/src/preferences/colorpaletteeditor.cpp b/src/preferences/colorpaletteeditor.cpp index 06136a461f6f..0df5b140f97e 100644 --- a/src/preferences/colorpaletteeditor.cpp +++ b/src/preferences/colorpaletteeditor.cpp @@ -194,7 +194,7 @@ void ColorPaletteEditor::slotAddColor() { void ColorPaletteEditor::slotRemoveColor() { QModelIndexList selection = m_pTableView->selectionModel()->selectedRows(); - for (const auto& index : selection) { + for (const auto& index : std::as_const(selection)) { //row selected int row = index.row(); m_pModel->removeRow(row); diff --git a/src/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 4ae8bd1c9655..755963206e48 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -273,7 +273,7 @@ void SoundDeviceNetwork::writeProcess(SINT framesPerBuffer) { QVector workers = m_pNetworkStream->outputWorkers(); - for (const auto& pWorker : workers) { + for (const auto& pWorker : std::as_const(workers)) { if (pWorker.isNull()) { continue; } diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp index b27cd1748542..fd0fe3199070 100644 --- a/src/soundio/soundmanager.cpp +++ b/src/soundio/soundmanager.cpp @@ -483,7 +483,7 @@ SoundDeviceStatus SoundManager::setupDevices() { qDebug() << outputDevicesOpened << "output sound devices opened"; qDebug() << inputDevicesOpened << "input sound devices opened"; - for (const auto& device: devicesNotFound) { + for (const auto& device : std::as_const(devicesNotFound)) { qWarning() << device << "not found"; } diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index 9d922bec0c67..89a7deaaf123 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -109,7 +109,7 @@ bool SoundManagerConfig::readFromDisk() { } int devicesMatchingByName = 0; - for (const auto& soundDevice : soundDevices) { + for (const auto& soundDevice : std::as_const(soundDevices)) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name) { devicesMatchingByName++; @@ -127,7 +127,7 @@ bool SoundManagerConfig::readFromDisk() { // very reliable as persistent identifiers across restarts of Mixxx. // Set deviceIdFromFile's alsaHwDevice and portAudioIndex to match // the hardwareDeviceId so operator== works for SoundDeviceId. - for (const auto& soundDevice : soundDevices) { + for (const auto& soundDevice : std::as_const(soundDevices)) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name) { deviceIdFromFile.alsaHwDevice = hardwareDeviceId.alsaHwDevice; @@ -146,7 +146,7 @@ bool SoundManagerConfig::readFromDisk() { // multiple devices with the same name. This might be possible // somehow with a udev rule matching device serial numbers, but // I have not tested this. - for (const auto& soundDevice : soundDevices) { + for (const auto& soundDevice : std::as_const(soundDevices)) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name && hardwareDeviceId.alsaHwDevice == deviceIdFromFile.alsaHwDevice) { @@ -156,7 +156,7 @@ bool SoundManagerConfig::readFromDisk() { } } else { // Check if the one of the matching devices has the configured in and output channels - for (const auto& soundDevice : soundDevices) { + for (const auto& soundDevice : std::as_const(soundDevices)) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name && soundDevice->getNumOutputChannels() >= @@ -515,7 +515,7 @@ void SoundManagerConfig::loadDefaults(SoundManager* soundManager, unsigned int f clearInputs(); QList outputDevices = soundManager->getDeviceList(m_api, true, false); if (!outputDevices.isEmpty()) { - for (const auto& pDevice: outputDevices) { + for (const auto& pDevice : std::as_const(outputDevices)) { if (pDevice->getNumOutputChannels() < 2) { continue; } diff --git a/src/test/seratobeatgridtest.cpp b/src/test/seratobeatgridtest.cpp index 8f5d4a723008..e92d2bfd1ef1 100644 --- a/src/test/seratobeatgridtest.cpp +++ b/src/test/seratobeatgridtest.cpp @@ -53,7 +53,7 @@ class SeratoBeatGridTest : public testing::Test { QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : fileList) { + for (const QFileInfo& fileInfo : std::as_const(fileList)) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/test/seratomarkers2test.cpp b/src/test/seratomarkers2test.cpp index ff1604b68f58..5f507acdadb3 100644 --- a/src/test/seratomarkers2test.cpp +++ b/src/test/seratomarkers2test.cpp @@ -124,7 +124,7 @@ class SeratoMarkers2Test : public testing::Test { QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : fileList) { + for (const QFileInfo& fileInfo : std::as_const(fileList)) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/test/seratomarkerstest.cpp b/src/test/seratomarkerstest.cpp index 2ad860c1e343..96c100818570 100644 --- a/src/test/seratomarkerstest.cpp +++ b/src/test/seratomarkerstest.cpp @@ -64,7 +64,7 @@ class SeratoMarkersTest : public testing::Test { QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : fileList) { + for (const QFileInfo& fileInfo : std::as_const(fileList)) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/waveform/renderers/waveformmark.cpp b/src/waveform/renderers/waveformmark.cpp index e1174f876389..f9d0ab567c75 100644 --- a/src/waveform/renderers/waveformmark.cpp +++ b/src/waveform/renderers/waveformmark.cpp @@ -27,7 +27,7 @@ Qt::Alignment decodeAlignmentFlags(const QString& alignString, Qt::Alignment def Qt::Alignment hflags; Qt::Alignment vflags; - for (const auto& stringFlag : stringFlags) { + for (const auto& stringFlag : std::as_const(stringFlags)) { if (stringFlag == "center") { hflags |= Qt::AlignHCenter; vflags |= Qt::AlignVCenter; diff --git a/src/waveform/renderers/waveformrendermarkbase.cpp b/src/waveform/renderers/waveformrendermarkbase.cpp index 2471dbf7044c..7d715a149141 100644 --- a/src/waveform/renderers/waveformrendermarkbase.cpp +++ b/src/waveform/renderers/waveformrendermarkbase.cpp @@ -58,7 +58,7 @@ void WaveformRenderMarkBase::updateMarksFromCues() { const int dimBrightThreshold = m_waveformRenderer->getDimBrightThreshold(); QList loadedCues = pTrackInfo->getCuePoints(); - for (const CuePointer& pCue : loadedCues) { + for (const CuePointer& pCue : std::as_const(loadedCues)) { const int hotCue = pCue->getHotCue(); if (hotCue == Cue::kNoHotCue) { continue; diff --git a/src/widget/weffectchainpresetbutton.cpp b/src/widget/weffectchainpresetbutton.cpp index d19b1f836f65..56e4f40d4621 100644 --- a/src/widget/weffectchainpresetbutton.cpp +++ b/src/widget/weffectchainpresetbutton.cpp @@ -129,13 +129,13 @@ void WEffectChainPresetButton::populateMenu() { effectSlotNumPrefix + pEffectSlot->getManifest()->displayName(), m_pMenu); - const ParameterMap loadedParameters = pEffectSlot->getLoadedParameters(); - const ParameterMap hiddenParameters = pEffectSlot->getHiddenParameters(); int numTypes = static_cast(EffectManifestParameter::ParameterType::NumTypes); for (int parameterTypeId = 0; parameterTypeId < numTypes; ++parameterTypeId) { const EffectManifestParameter::ParameterType parameterType = static_cast(parameterTypeId); - for (const auto& pParameter : loadedParameters.value(parameterType)) { + + const auto& loadedParameters = pEffectSlot->getLoadedParameters().value(parameterType); + for (const auto& pParameter : loadedParameters) { auto pCheckbox = make_parented(pEffectMenu); pCheckbox->setChecked(true); pCheckbox->setText(pParameter->manifest()->name()); @@ -154,7 +154,8 @@ void WEffectChainPresetButton::populateMenu() { pEffectMenu->addAction(pAction.get()); } - for (const auto& pParameter : hiddenParameters.value(parameterType)) { + const auto& hiddenParameters = pEffectSlot->getHiddenParameters().value(parameterType); + for (const auto& pParameter : hiddenParameters) { auto pCheckbox = make_parented(pEffectMenu); pCheckbox->setChecked(false); pCheckbox->setText(pParameter->manifest()->name()); diff --git a/src/widget/whotcuebutton.cpp b/src/widget/whotcuebutton.cpp index 903305e1b508..5e31d269f3c5 100644 --- a/src/widget/whotcuebutton.cpp +++ b/src/widget/whotcuebutton.cpp @@ -108,7 +108,7 @@ void WHotcueButton::mousePressEvent(QMouseEvent* e) { CuePointer pHotCue; QList cueList = pTrack->getCuePoints(); - for (const auto& pCue : cueList) { + for (const auto& pCue : std::as_const(cueList)) { if (pCue->getHotCue() == m_hotcue) { pHotCue = pCue; break; diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 446d56da6d1b..aab088b9f84e 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -538,7 +538,7 @@ void WOverview::mousePressEvent(QMouseEvent* e) { // WaveformMarks with Cues will need to be implemented. CuePointer pHoveredCue; QList cueList = m_pCurrentTrack->getCuePoints(); - for (const auto& pCue : cueList) { + for (const auto& pCue : std::as_const(cueList)) { if (pCue->getHotCue() == m_pHoveredMark->getHotCue()) { pHoveredCue = pCue; break; diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index d1fdffd0ebde..e004ab1264df 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -57,7 +57,7 @@ void WSplitter::setup(const QDomNode& node, const SkinContext& context) { QStringList sizesSplit = sizesJoined.split(","); QList sizesList; ok = false; - for (const QString& sizeStr : sizesSplit) { + for (const QString& sizeStr : std::as_const(sizesSplit)) { sizesList.push_back(sizeStr.toInt(&ok)); if (!ok) { break; @@ -78,7 +78,7 @@ void WSplitter::setup(const QDomNode& node, const SkinContext& context) { QStringList collapsibleSplit = collapsibleJoined.split(","); QList collapsibleList; ok = false; - for (const QString& collapsibleStr : collapsibleSplit) { + for (const QString& collapsibleStr : std::as_const(collapsibleSplit)) { collapsibleList.push_back(collapsibleStr.toInt(&ok)>0); if (!ok) { break; diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index b648b2ec60df..058852098d2b 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -1327,7 +1327,7 @@ void WTrackMenu::slotPopulatePlaylistMenu() { QList> playlists = playlistDao.getPlaylists(PlaylistDAO::PLHT_NOT_HIDDEN); - for (const auto& [id, name] : playlists) { + for (const auto& [id, name] : std::as_const(playlists)) { // No leak because making the menu the parent means they will be // auto-deleted int plId = id; From dffe5d040bf83d9457f1e54e55b45f8761974f4f Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:45:07 +0200 Subject: [PATCH 04/14] fix: add explicit virtual destructor in order to fix linker issues --- src/util/autofilereloader.cpp | 2 ++ src/util/autofilereloader.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/util/autofilereloader.cpp b/src/util/autofilereloader.cpp index 00d27fa65f2c..d0ac55ece3f5 100644 --- a/src/util/autofilereloader.cpp +++ b/src/util/autofilereloader.cpp @@ -6,6 +6,8 @@ #include "moc_autofilereloader.cpp" #include "util/runtimeloggingcategory.h" +AutoFileReloader::~AutoFileReloader() = default; + AutoFileReloader::AutoFileReloader(const RuntimeLoggingCategory& loggingCategory) : m_loggingCategory(loggingCategory) { connect(&m_fileWatcher, diff --git a/src/util/autofilereloader.h b/src/util/autofilereloader.h index 451d390d02ad..67ea73753df3 100644 --- a/src/util/autofilereloader.h +++ b/src/util/autofilereloader.h @@ -10,6 +10,7 @@ class AutoFileReloader : public QObject { Q_OBJECT public: explicit AutoFileReloader(const RuntimeLoggingCategory& loggingCategory); + ~AutoFileReloader() override; void clear() { const auto files = m_fileWatcher.files(); From 707a08f90316cafff215024f29b15a5ba8ed2029 Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:53:19 +0200 Subject: [PATCH 05/14] fix: add autofilereloader to mixxx-qml-lib target --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ecd7a092af0..437d3c0a1549 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2792,6 +2792,8 @@ if(QML) # The following sources need to be in this target to get QML_ELEMENT properly interpreted src/control/controlmodel.cpp src/control/controlsortfiltermodel.cpp + # needed for qml/qmlautoreload.cpp + src/util/autofilereloader.cpp ) # qt_finalize_target takes care that the resources :/mixxx.org/imports/Mixxx/ From 79feae81a5810df8ae35cd064e2dd55c6da21c9a Mon Sep 17 00:00:00 2001 From: ronso0 Date: Tue, 8 Oct 2024 22:42:14 +0200 Subject: [PATCH 06/14] (fix) Controllers: return from loadSettings() when there's no mapping file --- src/controllers/legacycontrollermapping.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/legacycontrollermapping.cpp b/src/controllers/legacycontrollermapping.cpp index 198487fa2f7f..dcdb515bfe2d 100644 --- a/src/controllers/legacycontrollermapping.cpp +++ b/src/controllers/legacycontrollermapping.cpp @@ -11,7 +11,11 @@ const QString kControllerSettingsResourcePathSubst = QStringLiteral("%RESOURCE_P void LegacyControllerMapping::loadSettings(UserSettingsPointer pConfig, const QString& controllerName) const { auto mappingFile = QFileInfo(m_filePath); - DEBUG_ASSERT(mappingFile.exists()); + if (!mappingFile.exists()) { + // This happens when we start the MIDI Learning Wizard with a new (empty) + // mapping, or when the mapping file has been removed manually by the user. + return; + } QString controllerPath = mappingFile.absoluteFilePath() .replace(pConfig->getSettingsPath(), From 0053ca0d27380b5c8e0359d23506fe8a81eeb588 Mon Sep 17 00:00:00 2001 From: Antoine C Date: Tue, 8 Oct 2024 22:08:34 +0100 Subject: [PATCH 07/14] fix: prevent deadlockwith stuck bulk transfer --- src/controllers/bulk/bulkcontroller.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/controllers/bulk/bulkcontroller.cpp b/src/controllers/bulk/bulkcontroller.cpp index 6a2d1212b65f..737346f16439 100644 --- a/src/controllers/bulk/bulkcontroller.cpp +++ b/src/controllers/bulk/bulkcontroller.cpp @@ -299,11 +299,12 @@ void BulkController::sendBytes(const QByteArray& data) { (unsigned char*)data.constData(), data.size(), &transferred, - 0); + 5000 // Send timeout in milliseconds + ); if (ret < 0) { qCWarning(m_logOutput) << "Unable to send data to" << getName() << "serial #" << m_sUID << "-" << libusb_error_name(ret); - } else { + } else if (CmdlineArgs::Instance().getControllerDebug()) { qCDebug(m_logOutput) << transferred << "bytes sent to" << getName() << "serial #" << m_sUID; } From e9fcde01a9fdfc981e5c5dd0cafec3111f471fe6 Mon Sep 17 00:00:00 2001 From: Joerg Date: Sun, 13 Oct 2024 19:08:17 +0200 Subject: [PATCH 08/14] Used const instead of std::as_const where possible --- src/broadcast/broadcastmanager.cpp | 20 +++++++++---------- src/controllers/controllermanager.cpp | 4 ++-- src/controllers/dlgprefcontroller.cpp | 4 ++-- src/dialog/dlgreplacecuecolor.cpp | 4 ++-- src/library/banshee/bansheefeature.cpp | 4 ++-- src/library/dao/trackdao.cpp | 4 ++-- src/library/trackcollection.cpp | 4 ++-- src/library/trackset/baseplaylistfeature.cpp | 4 ++-- src/library/trackset/crate/cratefeature.cpp | 4 ++-- src/preferences/broadcastsettings.cpp | 4 ++-- src/preferences/colorpaletteeditor.cpp | 4 ++-- src/soundio/sounddevicenetwork.cpp | 4 ++-- src/soundio/soundmanagerconfig.cpp | 16 ++++++++------- src/test/seratobeatgridtest.cpp | 4 ++-- src/test/seratomarkers2test.cpp | 4 ++-- src/test/seratomarkerstest.cpp | 4 ++-- src/waveform/renderers/waveformmark.cpp | 10 +++++----- .../renderers/waveformrendermarkbase.cpp | 4 ++-- src/widget/whotcuebutton.cpp | 4 ++-- src/widget/woverview.cpp | 4 ++-- src/widget/wsplitter.cpp | 8 ++++---- src/widget/wtrackmenu.cpp | 4 ++-- 22 files changed, 64 insertions(+), 62 deletions(-) diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp index 847dd4573e8f..6b574a75c6f9 100644 --- a/src/broadcast/broadcastmanager.cpp +++ b/src/broadcast/broadcastmanager.cpp @@ -42,8 +42,8 @@ BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager, shout_init(); // Initialize connections list from the current state of BroadcastSettings - QList profiles = m_pBroadcastSettings->profiles(); - for (const BroadcastProfilePtr& profile : std::as_const(profiles)) { + const QList profiles = m_pBroadcastSettings->profiles(); + for (const BroadcastProfilePtr& profile : profiles) { addConnection(profile); } @@ -117,8 +117,8 @@ void BroadcastManager::slotControlEnabled(double v) { } else { m_pBroadcastEnabled->set(false); m_pStatusCO->forceSet(STATUSCO_UNCONNECTED); - QList profiles = m_pBroadcastSettings->profiles(); - for (BroadcastProfilePtr profile : std::as_const(profiles)) { + const QList profiles = m_pBroadcastSettings->profiles(); + for (BroadcastProfilePtr profile : profiles) { if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) { profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED); } @@ -137,8 +137,8 @@ void BroadcastManager::slotProfileRemoved(BroadcastProfilePtr profile) { } void BroadcastManager::slotProfilesChanged() { - QVector workers = m_pNetworkStream->outputWorkers(); - for (const NetworkOutputStreamWorkerPtr& pWorker : std::as_const(workers)) { + const QVector workers = m_pNetworkStream->outputWorkers(); + for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection) { BroadcastProfilePtr profile = connection->profile(); @@ -198,8 +198,8 @@ bool BroadcastManager::removeConnection(BroadcastProfilePtr profile) { } ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePtr profile) { - QVector workers = m_pNetworkStream->outputWorkers(); - for (const NetworkOutputStreamWorkerPtr& pWorker : std::as_const(workers)) { + const QVector workers = m_pNetworkStream->outputWorkers(); + for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection.isNull()) { continue; @@ -219,8 +219,8 @@ void BroadcastManager::slotConnectionStatusChanged(int newState) { connectedCount = 0, failedCount = 0; // Collect status info - QList profiles = m_pBroadcastSettings->profiles(); - for (BroadcastProfilePtr profile : std::as_const(profiles)) { + const QList profiles = m_pBroadcastSettings->profiles(); + for (BroadcastProfilePtr profile : profiles) { if (!profile->getEnabled()) { continue; } diff --git a/src/controllers/controllermanager.cpp b/src/controllers/controllermanager.cpp index 8e0620da431f..def7b1985078 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -237,10 +237,10 @@ void ControllerManager::slotSetUpDevices() { qDebug() << "ControllerManager: Setting up devices"; updateControllerList(); - QList deviceList = getControllerList(false, true); + const QList deviceList = getControllerList(false, true); QStringList mappingPaths(getMappingPaths(m_pConfig)); - for (Controller* pController : std::as_const(deviceList)) { + for (Controller* pController : deviceList) { QString name = pController->getName(); if (pController->isOpen()) { diff --git a/src/controllers/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index 7135564d58fc..d7d460ee6f74 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -479,11 +479,11 @@ MappingInfo DlgPrefController::enumerateMappingsFromEnumerator( // re-enumerate on the next open of the preferences. if (!pMappingEnumerator.isNull()) { // Get a list of mappings in alphabetical order - QList systemMappings = + const QList systemMappings = pMappingEnumerator->getMappingsByExtension( m_pController->mappingExtension()); - for (const MappingInfo& mapping : std::as_const(systemMappings)) { + for (const MappingInfo& mapping : systemMappings) { m_ui.comboBoxMapping->addItem( icon, mapping.getName(), mapping.getPath()); if (m_pController->matchMapping(mapping)) { diff --git a/src/dialog/dlgreplacecuecolor.cpp b/src/dialog/dlgreplacecuecolor.cpp index 7b6c7a5a63ed..f0e7fbba2015 100644 --- a/src/dialog/dlgreplacecuecolor.cpp +++ b/src/dialog/dlgreplacecuecolor.cpp @@ -310,8 +310,8 @@ void DlgReplaceCueColor::slotApply() { } // Flush cached tracks to database - QSet cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds(); - for (const TrackId& trackId : std::as_const(cachedTrackIds)) { + const QSet cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds(); + for (const TrackId& trackId : cachedTrackIds) { TrackPointer pTrack = GlobalTrackCacheLocker().lookupTrackById(trackId); if (pTrack) { m_pTrackCollectionManager->saveTrack(pTrack); diff --git a/src/library/banshee/bansheefeature.cpp b/src/library/banshee/bansheefeature.cpp index 967cca982b40..c18befe6f48f 100644 --- a/src/library/banshee/bansheefeature.cpp +++ b/src/library/banshee/bansheefeature.cpp @@ -90,8 +90,8 @@ void BansheeFeature::activate() { m_isActivated = true; std::unique_ptr pRootItem = TreeItem::newRoot(this); - QList playlists = m_connection.getPlaylists(); - for (const BansheeDbConnection::Playlist& playlist : std::as_const(playlists)) { + const QList playlists = m_connection.getPlaylists(); + for (const BansheeDbConnection::Playlist& playlist : playlists) { qDebug() << playlist.name; // append the playlist to the child model pRootItem->appendChild(playlist.name, playlist.playlistId); diff --git a/src/library/dao/trackdao.cpp b/src/library/dao/trackdao.cpp index 8609833c8e45..725e181596ef 100644 --- a/src/library/dao/trackdao.cpp +++ b/src/library/dao/trackdao.cpp @@ -124,7 +124,7 @@ void TrackDAO::finish() { // Do housekeeping on the LibraryHashes/track_locations tables. qDebug() << "Cleaning LibraryHashes/track_locations tables."; SqlTransaction transaction(m_database); - QStringList deletedHashDirs = m_libraryHashDao.getDeletedDirectories(); + const QStringList deletedHashDirs = m_libraryHashDao.getDeletedDirectories(); // Delete any LibraryHashes directories that have been marked as deleted. m_libraryHashDao.removeDeletedDirectoryHashes(); @@ -132,7 +132,7 @@ void TrackDAO::finish() { // And mark the corresponding tracks in track_locations in the deleted // directories as deleted. // TODO(XXX) This doesn't handle sub-directories of deleted directories. - for (const auto& dir : std::as_const(deletedHashDirs)) { + for (const auto& dir : deletedHashDirs) { markTrackLocationsAsDeleted(m_database, dir); } transaction.commit(); diff --git a/src/library/trackcollection.cpp b/src/library/trackcollection.cpp index db39c08c0e66..7f9249be302b 100644 --- a/src/library/trackcollection.cpp +++ b/src/library/trackcollection.cpp @@ -391,10 +391,10 @@ bool TrackCollection::purgeAllTracks( const QDir& rootDir) { DEBUG_ASSERT_QOBJECT_THREAD_AFFINITY(this); - QList trackRefs = m_trackDao.getAllTrackRefs(rootDir); + const QList trackRefs = m_trackDao.getAllTrackRefs(rootDir); QList trackIds; trackIds.reserve(trackRefs.size()); - for (const auto& trackRef : std::as_const(trackRefs)) { + for (const auto& trackRef : trackRefs) { DEBUG_ASSERT(trackRef.hasId()); trackIds.append(trackRef.getId()); } diff --git a/src/library/trackset/baseplaylistfeature.cpp b/src/library/trackset/baseplaylistfeature.cpp index 2a155614e531..01f18ae15991 100644 --- a/src/library/trackset/baseplaylistfeature.cpp +++ b/src/library/trackset/baseplaylistfeature.cpp @@ -677,9 +677,9 @@ void BasePlaylistFeature::slotAnalyzePlaylist() { if (m_lastRightClickedIndex.isValid()) { int playlistId = playlistIdFromIndex(m_lastRightClickedIndex); if (playlistId >= 0) { - QList ids = m_playlistDao.getTrackIds(playlistId); + const QList ids = m_playlistDao.getTrackIds(playlistId); QList tracks; - for (auto id : std::as_const(ids)) { + for (auto id : ids) { tracks.append(id); } emit analyzeTracks(tracks); diff --git a/src/library/trackset/crate/cratefeature.cpp b/src/library/trackset/crate/cratefeature.cpp index c4c205fff884..dbe290a2e72b 100644 --- a/src/library/trackset/crate/cratefeature.cpp +++ b/src/library/trackset/crate/cratefeature.cpp @@ -693,7 +693,7 @@ void CrateFeature::slotImportPlaylistFile(const QString& playlistFile, CrateId c void CrateFeature::slotCreateImportCrate() { // Get file to read - QStringList playlistFiles = LibraryFeature::getPlaylistFiles(); + const QStringList playlistFiles = LibraryFeature::getPlaylistFiles(); if (playlistFiles.isEmpty()) { return; } @@ -707,7 +707,7 @@ void CrateFeature::slotCreateImportCrate() { CrateId lastCrateId; // For each selected file create a new crate - for (const QString& playlistFile : std::as_const(playlistFiles)) { + for (const QString& playlistFile : playlistFiles) { const QFileInfo fileInfo(playlistFile); Crate crate; diff --git a/src/preferences/broadcastsettings.cpp b/src/preferences/broadcastsettings.cpp index f581530863d5..9470bcbec58f 100644 --- a/src/preferences/broadcastsettings.cpp +++ b/src/preferences/broadcastsettings.cpp @@ -31,7 +31,7 @@ void BroadcastSettings::loadProfiles() { } QStringList nameFilters("*.bcp.xml"); - QFileInfoList files = + const QFileInfoList files = profilesFolder.entryInfoList(nameFilters, QDir::Files, QDir::Name); // If *.bcp.xml files exist in the profiles subfolder, those will be loaded @@ -49,7 +49,7 @@ void BroadcastSettings::loadProfiles() { kLogger.info() << "Found" << files.size() << "profile(s)"; // Load profiles from filesystem - for (const QFileInfo& fileInfo : std::as_const(files)) { + for (const QFileInfo& fileInfo : files) { BroadcastProfilePtr profile = BroadcastProfile::loadFromFile(fileInfo.absoluteFilePath()); diff --git a/src/preferences/colorpaletteeditor.cpp b/src/preferences/colorpaletteeditor.cpp index 0df5b140f97e..f850dae6b8ec 100644 --- a/src/preferences/colorpaletteeditor.cpp +++ b/src/preferences/colorpaletteeditor.cpp @@ -193,8 +193,8 @@ void ColorPaletteEditor::slotAddColor() { } void ColorPaletteEditor::slotRemoveColor() { - QModelIndexList selection = m_pTableView->selectionModel()->selectedRows(); - for (const auto& index : std::as_const(selection)) { + const QModelIndexList selection = m_pTableView->selectionModel()->selectedRows(); + for (const auto& index : selection) { //row selected int row = index.row(); m_pModel->removeRow(row); diff --git a/src/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 755963206e48..56658747d84b 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -271,9 +271,9 @@ void SoundDeviceNetwork::writeProcess(SINT framesPerBuffer) { m_outputFifo->aquireReadRegions(readAvailable, &dataPtr1, &size1, &dataPtr2, &size2); - QVector workers = + const QVector workers = m_pNetworkStream->outputWorkers(); - for (const auto& pWorker : std::as_const(workers)) { + for (const auto& pWorker : workers) { if (pWorker.isNull()) { continue; } diff --git a/src/soundio/soundmanagerconfig.cpp b/src/soundio/soundmanagerconfig.cpp index 89a7deaaf123..d1228bf54431 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -84,7 +84,8 @@ bool SoundManagerConfig::readFromDisk() { VERIFY_OR_DEBUG_ASSERT(m_pSoundManager != nullptr) { return false; } - QList soundDevices = m_pSoundManager->getDeviceList(m_api, true, true); + const QList soundDevices = + m_pSoundManager->getDeviceList(m_api, true, true); for (int i = 0; i < devElements.count(); ++i) { QDomElement devElement(devElements.at(i).toElement()); @@ -109,7 +110,7 @@ bool SoundManagerConfig::readFromDisk() { } int devicesMatchingByName = 0; - for (const auto& soundDevice : std::as_const(soundDevices)) { + for (const auto& soundDevice : soundDevices) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name) { devicesMatchingByName++; @@ -127,7 +128,7 @@ bool SoundManagerConfig::readFromDisk() { // very reliable as persistent identifiers across restarts of Mixxx. // Set deviceIdFromFile's alsaHwDevice and portAudioIndex to match // the hardwareDeviceId so operator== works for SoundDeviceId. - for (const auto& soundDevice : std::as_const(soundDevices)) { + for (const auto& soundDevice : soundDevices) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name) { deviceIdFromFile.alsaHwDevice = hardwareDeviceId.alsaHwDevice; @@ -146,7 +147,7 @@ bool SoundManagerConfig::readFromDisk() { // multiple devices with the same name. This might be possible // somehow with a udev rule matching device serial numbers, but // I have not tested this. - for (const auto& soundDevice : std::as_const(soundDevices)) { + for (const auto& soundDevice : soundDevices) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name && hardwareDeviceId.alsaHwDevice == deviceIdFromFile.alsaHwDevice) { @@ -156,7 +157,7 @@ bool SoundManagerConfig::readFromDisk() { } } else { // Check if the one of the matching devices has the configured in and output channels - for (const auto& soundDevice : std::as_const(soundDevices)) { + for (const auto& soundDevice : soundDevices) { SoundDeviceId hardwareDeviceId = soundDevice->getDeviceId(); if (hardwareDeviceId.name == deviceIdFromFile.name && soundDevice->getNumOutputChannels() >= @@ -513,9 +514,10 @@ void SoundManagerConfig::loadDefaults(SoundManager* soundManager, unsigned int f if (flags & SoundManagerConfig::DEVICES) { clearOutputs(); clearInputs(); - QList outputDevices = soundManager->getDeviceList(m_api, true, false); + const QList outputDevices = + soundManager->getDeviceList(m_api, true, false); if (!outputDevices.isEmpty()) { - for (const auto& pDevice : std::as_const(outputDevices)) { + for (const auto& pDevice : outputDevices) { if (pDevice->getNumOutputChannels() < 2) { continue; } diff --git a/src/test/seratobeatgridtest.cpp b/src/test/seratobeatgridtest.cpp index e92d2bfd1ef1..8dd7d4ef1b08 100644 --- a/src/test/seratobeatgridtest.cpp +++ b/src/test/seratobeatgridtest.cpp @@ -51,9 +51,9 @@ class SeratoBeatGridTest : public testing::Test { dir.setFilter(QDir::Files); dir.setNameFilters(QStringList() << "*.octet-stream"); - QFileInfoList fileList = dir.entryInfoList(); + const QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : std::as_const(fileList)) { + for (const QFileInfo& fileInfo : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/test/seratomarkers2test.cpp b/src/test/seratomarkers2test.cpp index 5f507acdadb3..9884eb0af130 100644 --- a/src/test/seratomarkers2test.cpp +++ b/src/test/seratomarkers2test.cpp @@ -122,9 +122,9 @@ class SeratoMarkers2Test : public testing::Test { dir.setFilter(QDir::Files); dir.setNameFilters(QStringList() << "*.octet-stream"); - QFileInfoList fileList = dir.entryInfoList(); + const QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : std::as_const(fileList)) { + for (const QFileInfo& fileInfo : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/test/seratomarkerstest.cpp b/src/test/seratomarkerstest.cpp index 96c100818570..b1b25d1455c7 100644 --- a/src/test/seratomarkerstest.cpp +++ b/src/test/seratomarkerstest.cpp @@ -62,9 +62,9 @@ class SeratoMarkersTest : public testing::Test { dir.setFilter(QDir::Files); dir.setNameFilters(QStringList() << "*.octet-stream"); - QFileInfoList fileList = dir.entryInfoList(); + const QFileInfoList fileList = dir.entryInfoList(); EXPECT_FALSE(fileList.isEmpty()); - for (const QFileInfo& fileInfo : std::as_const(fileList)) { + for (const QFileInfo& fileInfo : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); QFile file(dir.filePath(fileInfo.fileName())); bool openOk = file.open(QIODevice::ReadOnly); diff --git a/src/waveform/renderers/waveformmark.cpp b/src/waveform/renderers/waveformmark.cpp index f9d0ab567c75..e6e5c79af379 100644 --- a/src/waveform/renderers/waveformmark.cpp +++ b/src/waveform/renderers/waveformmark.cpp @@ -16,18 +16,18 @@ namespace { constexpr float lineHoverPadding = 5.0; Qt::Alignment decodeAlignmentFlags(const QString& alignString, Qt::Alignment defaultFlags) { - QStringList stringFlags = alignString.toLower() - .split('|', + const QStringList stringFlags = alignString.toLower() + .split('|', #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) - Qt::SkipEmptyParts); + Qt::SkipEmptyParts); #else - QString::SkipEmptyParts); + QString::SkipEmptyParts); #endif Qt::Alignment hflags; Qt::Alignment vflags; - for (const auto& stringFlag : std::as_const(stringFlags)) { + for (const auto& stringFlag : stringFlags) { if (stringFlag == "center") { hflags |= Qt::AlignHCenter; vflags |= Qt::AlignVCenter; diff --git a/src/waveform/renderers/waveformrendermarkbase.cpp b/src/waveform/renderers/waveformrendermarkbase.cpp index 7d715a149141..f250b73acc18 100644 --- a/src/waveform/renderers/waveformrendermarkbase.cpp +++ b/src/waveform/renderers/waveformrendermarkbase.cpp @@ -57,8 +57,8 @@ void WaveformRenderMarkBase::updateMarksFromCues() { } const int dimBrightThreshold = m_waveformRenderer->getDimBrightThreshold(); - QList loadedCues = pTrackInfo->getCuePoints(); - for (const CuePointer& pCue : std::as_const(loadedCues)) { + const QList loadedCues = pTrackInfo->getCuePoints(); + for (const CuePointer& pCue : loadedCues) { const int hotCue = pCue->getHotCue(); if (hotCue == Cue::kNoHotCue) { continue; diff --git a/src/widget/whotcuebutton.cpp b/src/widget/whotcuebutton.cpp index 5e31d269f3c5..7ae599b7ca6d 100644 --- a/src/widget/whotcuebutton.cpp +++ b/src/widget/whotcuebutton.cpp @@ -107,8 +107,8 @@ void WHotcueButton::mousePressEvent(QMouseEvent* e) { } CuePointer pHotCue; - QList cueList = pTrack->getCuePoints(); - for (const auto& pCue : std::as_const(cueList)) { + const QList cueList = pTrack->getCuePoints(); + for (const auto& pCue : cueList) { if (pCue->getHotCue() == m_hotcue) { pHotCue = pCue; break; diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index aab088b9f84e..756f6856f832 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -537,8 +537,8 @@ void WOverview::mousePressEvent(QMouseEvent* e) { // WOverview in the future, another way to associate // WaveformMarks with Cues will need to be implemented. CuePointer pHoveredCue; - QList cueList = m_pCurrentTrack->getCuePoints(); - for (const auto& pCue : std::as_const(cueList)) { + const QList cueList = m_pCurrentTrack->getCuePoints(); + for (const auto& pCue : cueList) { if (pCue->getHotCue() == m_pHoveredMark->getHotCue()) { pHoveredCue = pCue; break; diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index e004ab1264df..c2bcd0ab6eaf 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -54,10 +54,10 @@ void WSplitter::setup(const QDomNode& node, const SkinContext& context) { // found some value for splitsizes? if (!sizesJoined.isEmpty()) { - QStringList sizesSplit = sizesJoined.split(","); + const QStringList sizesSplit = sizesJoined.split(","); QList sizesList; ok = false; - for (const QString& sizeStr : std::as_const(sizesSplit)) { + for (const QString& sizeStr : sizesSplit) { sizesList.push_back(sizeStr.toInt(&ok)); if (!ok) { break; @@ -75,10 +75,10 @@ void WSplitter::setup(const QDomNode& node, const SkinContext& context) { // Which children can be collapsed? QString collapsibleJoined; if (context.hasNodeSelectString(node, "Collapsible", &collapsibleJoined)) { - QStringList collapsibleSplit = collapsibleJoined.split(","); + const QStringList collapsibleSplit = collapsibleJoined.split(","); QList collapsibleList; ok = false; - for (const QString& collapsibleStr : std::as_const(collapsibleSplit)) { + for (const QString& collapsibleStr : collapsibleSplit) { collapsibleList.push_back(collapsibleStr.toInt(&ok)>0); if (!ok) { break; diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index 058852098d2b..64503db224bf 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -1324,10 +1324,10 @@ void WTrackMenu::slotPopulatePlaylistMenu() { const PlaylistDAO& playlistDao = m_pLibrary->trackCollectionManager() ->internalCollection() ->getPlaylistDAO(); - QList> playlists = + const QList> playlists = playlistDao.getPlaylists(PlaylistDAO::PLHT_NOT_HIDDEN); - for (const auto& [id, name] : std::as_const(playlists)) { + for (const auto& [id, name] : playlists) { // No leak because making the menu the parent means they will be // auto-deleted int plId = id; From 3de02306e43962956604c9abf0a64c9ad44682f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:38:04 +0000 Subject: [PATCH 09/14] Bump actions/upload-artifact from 4.4.1 to 4.4.3 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.1 to 4.4.3. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v4.4.1...v4.4.3) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build.yml | 2 +- .github/workflows/pre-commit.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f90645b83fac..960ce1a7d200 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -473,7 +473,7 @@ jobs: - name: "Upload GitHub Actions artifacts" if: matrix.artifacts_path != null - uses: actions/upload-artifact@v4.4.1 + uses: actions/upload-artifact@v4.4.3 with: name: ${{ matrix.artifacts_name }} path: ${{ matrix.artifacts_path }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 3613e207f5f3..a7822ed31e30 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -67,14 +67,14 @@ jobs: - name: "Upload patch artifact" if: failure() && env.UPLOAD_PATCH_FILE != null - uses: actions/upload-artifact@v4.4.1 + uses: actions/upload-artifact@v4.4.3 with: name: ${{ env.UPLOAD_PATCH_FILE }} path: ${{ env.UPLOAD_PATCH_FILE }} - name: "Upload pre-commit.log" if: failure() && env.UPLOAD_PATCH_FILE == null - uses: actions/upload-artifact@v4.4.1 + uses: actions/upload-artifact@v4.4.3 with: name: pre-commit.log path: /github/home/.cache/pre-commit/pre-commit.log From 5ec234394f082884fa2e5057fdbd077ad9f254fb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:38:06 +0000 Subject: [PATCH 10/14] Bump coverallsapp/github-action from 2.3.0 to 2.3.1 Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/coverallsapp/github-action/releases) - [Commits](https://github.com/coverallsapp/github-action/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: coverallsapp/github-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- .github/workflows/build-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-checks.yml b/.github/workflows/build-checks.yml index 4eeebcc4f3fb..084cc68ed0d6 100644 --- a/.github/workflows/build-checks.yml +++ b/.github/workflows/build-checks.yml @@ -157,7 +157,7 @@ jobs: - name: "Upload Coverage Report to coveralls.io" if: matrix.name == 'coverage' continue-on-error: true - uses: coverallsapp/github-action@v2.3.0 + uses: coverallsapp/github-action@v2.3.1 with: flag-name: ubuntu-22.04 path-to-lcov: build/lcov.info From 2245b3eaaf28acda87025131813da7105172fc57 Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 12 Oct 2024 12:38:23 +0200 Subject: [PATCH 11/14] Fix additional "c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]" errors in 2.5 branch --- src/controllers/controlpickermenu.cpp | 2 +- src/controllers/legacycontrollermapping.cpp | 2 +- src/library/dlgtrackinfomulti.cpp | 10 +++++----- src/library/searchqueryparser.cpp | 2 +- src/qml/qmlplayerproxy.cpp | 3 ++- src/widget/wtracktableview.cpp | 2 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index 1c5de6e2ef52..dc48f9fa1856 100644 --- a/src/controllers/controlpickermenu.cpp +++ b/src/controllers/controlpickermenu.cpp @@ -661,7 +661,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent) "position as loop end") + noBeatsSeconds; - QList beatSizes = LoopingControl::getBeatSizes(); + const QList beatSizes = LoopingControl::getBeatSizes(); QMap humanBeatSizes; humanBeatSizes[0.03125] = tr("1/32"); diff --git a/src/controllers/legacycontrollermapping.cpp b/src/controllers/legacycontrollermapping.cpp index dcdb515bfe2d..0f5978e971d5 100644 --- a/src/controllers/legacycontrollermapping.cpp +++ b/src/controllers/legacycontrollermapping.cpp @@ -27,7 +27,7 @@ void LegacyControllerMapping::loadSettings(UserSettingsPointer pConfig, .arg(controllerName, controllerPath); auto availableSettings = getSettings(); - QList definedSettings = pConfig->getKeysWithGroup(controllerKey); + const QList definedSettings = pConfig->getKeysWithGroup(controllerKey); QList availableSettingKeys; for (const auto& pSetting : std::as_const(availableSettings)) { diff --git a/src/library/dlgtrackinfomulti.cpp b/src/library/dlgtrackinfomulti.cpp index 529766d86733..e8ecf98a7ab2 100644 --- a/src/library/dlgtrackinfomulti.cpp +++ b/src/library/dlgtrackinfomulti.cpp @@ -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; @@ -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; @@ -377,7 +377,7 @@ void DlgTrackInfoMulti::updateTrackMetadataFields() { QSet samplerates; QSet 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()); @@ -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 @@ -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; diff --git a/src/library/searchqueryparser.cpp b/src/library/searchqueryparser.cpp index 9f7922a92ef4..519b2c4ef830 100644 --- a/src/library/searchqueryparser.cpp +++ b/src/library/searchqueryparser.cpp @@ -310,7 +310,7 @@ std::unique_ptr SearchQueryParser::parseAndNode(const QString& query) c std::unique_ptr SearchQueryParser::parseOrNode(const QString& query) const { auto pQuery = std::make_unique(); - QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp, + const QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp, #if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0) Qt::SkipEmptyParts); #else diff --git a/src/qml/qmlplayerproxy.cpp b/src/qml/qmlplayerproxy.cpp index f15a1197489b..0cc025b21764 100644 --- a/src/qml/qmlplayerproxy.cpp +++ b/src/qml/qmlplayerproxy.cpp @@ -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); diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 8b2eba3de104..427c68814ac6 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -795,7 +795,7 @@ QModelIndexList WTrackTableView::getSelectedRows() const { } QList WTrackTableView::getSelectedRowNumbers() const { - QModelIndexList indices = getSelectedRows(); + const QModelIndexList indices = getSelectedRows(); QList selectedRows; for (const QModelIndex& idx : indices) { selectedRows.append(idx.row()); From d2faf1d0483994da4b970912f01c379eadc5b9ed Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 12 Oct 2024 12:43:21 +0200 Subject: [PATCH 12/14] Fix "Use QLatin1String("") or QString() instead of an empty QStringLiteral [-Wclazy-empty-qstringliteral]" error --- src/library/dlgtrackinfomulti.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/dlgtrackinfomulti.cpp b/src/library/dlgtrackinfomulti.cpp index e8ecf98a7ab2..80326da771e7 100644 --- a/src/library/dlgtrackinfomulti.cpp +++ b/src/library/dlgtrackinfomulti.cpp @@ -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); From 456f8a37a180509bebed107aedcf4f102e2606c4 Mon Sep 17 00:00:00 2001 From: Joerg Date: Sat, 12 Oct 2024 12:38:23 +0200 Subject: [PATCH 13/14] Fix additional "c++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]" errors in main --- src/test/controllerrenderingengine_test.cpp | 3 ++- src/track/steminfoimporter.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/controllerrenderingengine_test.cpp b/src/test/controllerrenderingengine_test.cpp index 885ae68df156..7319419de043 100644 --- a/src/test/controllerrenderingengine_test.cpp +++ b/src/test/controllerrenderingengine_test.cpp @@ -34,7 +34,8 @@ class MockRenderingEngine : public ControllerRenderingEngine { }; TEST_F(ControllerRenderingEngineTest, createValidRendererWithSupportedTypes) { - for (auto pixelFormat : supportedPixelFormat()) { + const auto& supportedPixelFormats = supportedPixelFormat(); + for (const auto& pixelFormat : supportedPixelFormats) { MockRenderingEngine screenTest(LegacyControllerMapping::ScreenInfo{ "", // identifier QSize(0, 0), // size diff --git a/src/track/steminfoimporter.cpp b/src/track/steminfoimporter.cpp index cbff8593a207..54db7d9c9069 100644 --- a/src/track/steminfoimporter.cpp +++ b/src/track/steminfoimporter.cpp @@ -171,7 +171,7 @@ QList StemInfoImporter::importStemInfos( kLogger.debug() << "Unexpected or missing stems value in STEM manifest"; return {}; } - auto stemArray = stems.toArray(); + const auto stemArray = stems.toArray(); QList stemsList; stemsList.reserve(stemArray.size()); int stemIdx = 0; From 8961bba53d968a7343062587aed752cd20c3daab Mon Sep 17 00:00:00 2001 From: Antoine C Date: Sat, 19 Oct 2024 21:12:12 +0100 Subject: [PATCH 14/14] chore: pin Node.JS pre-commit hooks to use LTS --- .pre-commit-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39f2b52fcd7a..a7c718a7742e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -114,6 +114,7 @@ repos: rev: v0.13.0 hooks: - id: markdownlint-cli2 + language_version: lts - repo: https://github.com/python-jsonschema/check-jsonschema rev: 0.29.1 hooks: