diff --git a/src/broadcast/broadcastmanager.cpp b/src/broadcast/broadcastmanager.cpp index f3e9e25b6b4..6936761bf63 100644 --- a/src/broadcast/broadcastmanager.cpp +++ b/src/broadcast/broadcastmanager.cpp @@ -36,7 +36,7 @@ BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager, shout_init(); // Initialize connections list from the current state of BroadcastSettings - QList profiles = m_pBroadcastSettings->profiles(); + const QList profiles = m_pBroadcastSettings->profiles(); for (const BroadcastProfilePtr& profile : profiles) { addConnection(profile); } @@ -92,7 +92,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; @@ -111,11 +111,11 @@ void BroadcastManager::slotControlEnabled(double v) { } else { 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); - } + const QList profiles = m_pBroadcastSettings->profiles(); + for (BroadcastProfilePtr profile : profiles) { + if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) { + profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED); + } } } @@ -131,7 +131,7 @@ void BroadcastManager::slotProfileRemoved(BroadcastProfilePtr profile) { } void BroadcastManager::slotProfilesChanged() { - QVector workers = m_pNetworkStream->outputWorkers(); + const QVector workers = m_pNetworkStream->outputWorkers(); for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection) { @@ -192,7 +192,7 @@ bool BroadcastManager::removeConnection(BroadcastProfilePtr profile) { } ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePtr profile) { - QVector workers = m_pNetworkStream->outputWorkers(); + const QVector workers = m_pNetworkStream->outputWorkers(); for (const NetworkOutputStreamWorkerPtr& pWorker : workers) { ShoutConnectionPtr connection = qSharedPointerCast(pWorker); if (connection.isNull()) { @@ -213,7 +213,7 @@ void BroadcastManager::slotConnectionStatusChanged(int newState) { connectedCount = 0, failedCount = 0; // Collect status info - QList profiles = m_pBroadcastSettings->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 073ee897cbb..1654fe85a94 100644 --- a/src/controllers/controllermanager.cpp +++ b/src/controllers/controllermanager.cpp @@ -243,7 +243,7 @@ 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 : deviceList) { diff --git a/src/controllers/controlpickermenu.cpp b/src/controllers/controlpickermenu.cpp index 1c5de6e2ef5..dc48f9fa185 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/dlgprefcontroller.cpp b/src/controllers/dlgprefcontroller.cpp index d58fbf6b673..396f85d1d91 100644 --- a/src/controllers/dlgprefcontroller.cpp +++ b/src/controllers/dlgprefcontroller.cpp @@ -516,7 +516,7 @@ 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()); diff --git a/src/controllers/dlgprefcontrollers.cpp b/src/controllers/dlgprefcontrollers.cpp index 8742c251337..7aefbe2acce 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -145,7 +145,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()) { @@ -175,7 +175,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/legacycontrollermapping.cpp b/src/controllers/legacycontrollermapping.cpp index 198487fa2f7..0f5978e971d 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(), @@ -23,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/controllers/midi/legacymidicontrollermappingfilehandler.cpp b/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp index b285ae1adfa..4003763d595 100644 --- a/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp +++ b/src/controllers/midi/legacymidicontrollermappingfilehandler.cpp @@ -241,7 +241,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) { @@ -255,7 +255,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 3e34477e8c5..f0e7fbba201 100644 --- a/src/dialog/dlgreplacecuecolor.cpp +++ b/src/dialog/dlgreplacecuecolor.cpp @@ -310,7 +310,7 @@ void DlgReplaceCueColor::slotApply() { } // Flush cached tracks to database - QSet cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds(); + const QSet cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds(); for (const TrackId& trackId : cachedTrackIds) { TrackPointer pTrack = GlobalTrackCacheLocker().lookupTrackById(trackId); if (pTrack) { diff --git a/src/effects/effectslot.cpp b/src/effects/effectslot.cpp index 4cc0284766b..6aabbcf0283 100644 --- a/src/effects/effectslot.cpp +++ b/src/effects/effectslot.cpp @@ -330,8 +330,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 b3e087d9bcc..5f7918d94c5 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 71f01260192..c18befe6f48 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: 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 e20fca363a2..78ee0121edc 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: deletedHashDirs) { + for (const auto& dir : deletedHashDirs) { markTrackLocationsAsDeleted(m_database, dir); } transaction.commit(); diff --git a/src/library/dlgtrackinfomulti.cpp b/src/library/dlgtrackinfomulti.cpp index 529766d8673..80326da771e 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 @@ -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); @@ -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 9f7922a92ef..519b2c4ef83 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/library/trackcollection.cpp b/src/library/trackcollection.cpp index 1c81a16a79c..a4b7a46549a 100644 --- a/src/library/trackcollection.cpp +++ b/src/library/trackcollection.cpp @@ -398,7 +398,7 @@ 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 : trackRefs) { diff --git a/src/library/trackset/baseplaylistfeature.cpp b/src/library/trackset/baseplaylistfeature.cpp index 6e3c5b2c550..e3de10e0ab7 100644 --- a/src/library/trackset/baseplaylistfeature.cpp +++ b/src/library/trackset/baseplaylistfeature.cpp @@ -677,7 +677,7 @@ 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 : ids) { tracks.append(id); diff --git a/src/library/trackset/crate/cratefeature.cpp b/src/library/trackset/crate/cratefeature.cpp index a34bd04cca6..7f872f22d20 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; } diff --git a/src/musicbrainz/web/coverartarchiveimagetask.h b/src/musicbrainz/web/coverartarchiveimagetask.h index 77963063997..01bfb3f8042 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 64116408dd8..da7f61ccf33 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 0b83c3e8d60..ac171df364e 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 diff --git a/src/preferences/broadcastsettings.cpp b/src/preferences/broadcastsettings.cpp index 212ceca8a96..8c899cdc3ec 100644 --- a/src/preferences/broadcastsettings.cpp +++ b/src/preferences/broadcastsettings.cpp @@ -32,7 +32,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 diff --git a/src/preferences/colorpaletteeditor.cpp b/src/preferences/colorpaletteeditor.cpp index 06136a461f6..f850dae6b8e 100644 --- a/src/preferences/colorpaletteeditor.cpp +++ b/src/preferences/colorpaletteeditor.cpp @@ -193,7 +193,7 @@ void ColorPaletteEditor::slotAddColor() { } void ColorPaletteEditor::slotRemoveColor() { - QModelIndexList selection = m_pTableView->selectionModel()->selectedRows(); + const QModelIndexList selection = m_pTableView->selectionModel()->selectedRows(); for (const auto& index : selection) { //row selected int row = index.row(); diff --git a/src/qml/qmlplayerproxy.cpp b/src/qml/qmlplayerproxy.cpp index 9b6beb52e75..d3b6056fda6 100644 --- a/src/qml/qmlplayerproxy.cpp +++ b/src/qml/qmlplayerproxy.cpp @@ -274,7 +274,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/skin/legacy/tooltips.cpp b/src/skin/legacy/tooltips.cpp index 0623c2a2df0..cff9c4ed1e8 100644 --- a/src/skin/legacy/tooltips.cpp +++ b/src/skin/legacy/tooltips.cpp @@ -48,6 +48,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/soundio/sounddevicenetwork.cpp b/src/soundio/sounddevicenetwork.cpp index 680bed9b462..cef9669e20d 100644 --- a/src/soundio/sounddevicenetwork.cpp +++ b/src/soundio/sounddevicenetwork.cpp @@ -274,7 +274,7 @@ 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 : workers) { if (pWorker.isNull()) { diff --git a/src/soundio/soundmanager.cpp b/src/soundio/soundmanager.cpp index 572133020a4..273211831ca 100644 --- a/src/soundio/soundmanager.cpp +++ b/src/soundio/soundmanager.cpp @@ -494,7 +494,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 a47439f1392..a13a987327c 100644 --- a/src/soundio/soundmanagerconfig.cpp +++ b/src/soundio/soundmanagerconfig.cpp @@ -85,7 +85,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()); @@ -508,9 +509,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: outputDevices) { + for (const auto& pDevice : outputDevices) { if (pDevice->getNumOutputChannels() < 2) { continue; } diff --git a/src/test/seratobeatgridtest.cpp b/src/test/seratobeatgridtest.cpp index 8f5d4a72300..8dd7d4ef1b0 100644 --- a/src/test/seratobeatgridtest.cpp +++ b/src/test/seratobeatgridtest.cpp @@ -51,7 +51,7 @@ 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 : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); diff --git a/src/test/seratomarkers2test.cpp b/src/test/seratomarkers2test.cpp index ff1604b68f5..9884eb0af13 100644 --- a/src/test/seratomarkers2test.cpp +++ b/src/test/seratomarkers2test.cpp @@ -122,7 +122,7 @@ 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 : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); diff --git a/src/test/seratomarkerstest.cpp b/src/test/seratomarkerstest.cpp index 2ad860c1e34..b1b25d1455c 100644 --- a/src/test/seratomarkerstest.cpp +++ b/src/test/seratomarkerstest.cpp @@ -62,7 +62,7 @@ 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 : fileList) { qDebug() << "--- File:" << fileInfo.fileName(); diff --git a/src/waveform/renderers/waveformmark.cpp b/src/waveform/renderers/waveformmark.cpp index 0e8a15225a5..809e633e551 100644 --- a/src/waveform/renderers/waveformmark.cpp +++ b/src/waveform/renderers/waveformmark.cpp @@ -16,12 +16,12 @@ 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; diff --git a/src/waveform/renderers/waveformrendermarkbase.cpp b/src/waveform/renderers/waveformrendermarkbase.cpp index 2471dbf7044..f250b73acc1 100644 --- a/src/waveform/renderers/waveformrendermarkbase.cpp +++ b/src/waveform/renderers/waveformrendermarkbase.cpp @@ -57,7 +57,7 @@ void WaveformRenderMarkBase::updateMarksFromCues() { } const int dimBrightThreshold = m_waveformRenderer->getDimBrightThreshold(); - QList loadedCues = pTrackInfo->getCuePoints(); + const QList loadedCues = pTrackInfo->getCuePoints(); for (const CuePointer& pCue : loadedCues) { const int hotCue = pCue->getHotCue(); if (hotCue == Cue::kNoHotCue) { diff --git a/src/widget/weffectchainpresetbutton.cpp b/src/widget/weffectchainpresetbutton.cpp index d19b1f836f6..56e4f40d462 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 0e91f1812ad..2adb77304d5 100644 --- a/src/widget/whotcuebutton.cpp +++ b/src/widget/whotcuebutton.cpp @@ -107,7 +107,7 @@ void WHotcueButton::mousePressEvent(QMouseEvent* e) { } CuePointer pHotCue; - QList cueList = pTrack->getCuePoints(); + const QList cueList = pTrack->getCuePoints(); for (const auto& pCue : cueList) { if (pCue->getHotCue() == m_hotcue) { pHotCue = pCue; diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index dd44cb74159..ec267f647f0 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -581,6 +581,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; @@ -594,7 +595,7 @@ 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(); + const QList cueList = m_pCurrentTrack->getCuePoints(); for (const auto& pCue : cueList) { if (pCue->getHotCue() == m_pHoveredMark->getHotCue()) { pHoveredCue = pCue; diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index d1fdffd0ebd..c2bcd0ab6ea 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -54,7 +54,7 @@ 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 : sizesSplit) { @@ -75,7 +75,7 @@ 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 : collapsibleSplit) { diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index b434c37a0a3..ef1b52b35fc 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -1417,7 +1417,7 @@ 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] : playlists) { diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 8b2eba3de10..427c68814ac 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());