Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/2.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoergAtGithub committed Oct 15, 2024
2 parents c4a740a + c14bd80 commit 6efbf8c
Show file tree
Hide file tree
Showing 38 changed files with 81 additions and 68 deletions.
20 changes: 10 additions & 10 deletions src/broadcast/broadcastmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager,
shout_init();

// Initialize connections list from the current state of BroadcastSettings
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
const QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
for (const BroadcastProfilePtr& profile : profiles) {
addConnection(profile);
}
Expand Down Expand Up @@ -92,7 +92,7 @@ void BroadcastManager::slotControlEnabled(double v) {
if (v > 0.0) {
bool atLeastOneEnabled = false;
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
for (const BroadcastProfilePtr& profile : profiles) {
for (const BroadcastProfilePtr& profile : std::as_const(profiles)) {
if (profile->getEnabled()) {
atLeastOneEnabled = true;
break;
Expand All @@ -111,11 +111,11 @@ void BroadcastManager::slotControlEnabled(double v) {
} else {
m_pBroadcastEnabled->set(false);
m_pStatusCO->forceSet(STATUSCO_UNCONNECTED);
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
for(BroadcastProfilePtr profile : profiles) {
if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) {
profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED);
}
const QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
for (BroadcastProfilePtr profile : profiles) {
if (profile->connectionStatus() == BroadcastProfile::STATUS_FAILURE) {
profile->setConnectionStatus(BroadcastProfile::STATUS_UNCONNECTED);
}
}
}

Expand All @@ -131,7 +131,7 @@ void BroadcastManager::slotProfileRemoved(BroadcastProfilePtr profile) {
}

void BroadcastManager::slotProfilesChanged() {
QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
const QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
for (const NetworkOutputStreamWorkerPtr& pWorker : workers) {
ShoutConnectionPtr connection = qSharedPointerCast<ShoutConnection>(pWorker);
if (connection) {
Expand Down Expand Up @@ -192,7 +192,7 @@ bool BroadcastManager::removeConnection(BroadcastProfilePtr profile) {
}

ShoutConnectionPtr BroadcastManager::findConnectionForProfile(BroadcastProfilePtr profile) {
QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
const QVector<NetworkOutputStreamWorkerPtr> workers = m_pNetworkStream->outputWorkers();
for (const NetworkOutputStreamWorkerPtr& pWorker : workers) {
ShoutConnectionPtr connection = qSharedPointerCast<ShoutConnection>(pWorker);
if (connection.isNull()) {
Expand All @@ -213,7 +213,7 @@ void BroadcastManager::slotConnectionStatusChanged(int newState) {
connectedCount = 0, failedCount = 0;

// Collect status info
QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
const QList<BroadcastProfilePtr> profiles = m_pBroadcastSettings->profiles();
for (BroadcastProfilePtr profile : profiles) {
if (!profile->getEnabled()) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/controllermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void ControllerManager::slotSetUpDevices() {
qDebug() << "ControllerManager: Setting up devices";

updateControllerList();
QList<Controller*> deviceList = getControllerList(false, true);
const QList<Controller*> deviceList = getControllerList(false, true);
QStringList mappingPaths(getMappingPaths(m_pConfig));

for (Controller* pController : deviceList) {
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/controlpickermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ ControlPickerMenu::ControlPickerMenu(QWidget* pParent)
"position as loop end") +
noBeatsSeconds;

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

QMap<double, QString> humanBeatSizes;
humanBeatSizes[0.03125] = tr("1/32");
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/dlgprefcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<MappingInfo> systemMappings =
const QList<MappingInfo> systemMappings =
pMappingEnumerator->getMappingsByExtension(
m_pController->mappingExtension());

Expand Down
4 changes: 2 additions & 2 deletions src/controllers/dlgprefcontrollers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void DlgPrefControllers::destroyControllerWidgets() {
// to keep this dialog and the controllermanager consistent.
QList<Controller*> controllerList =
m_pControllerManager->getControllerList(false, true);
for (auto* pController : controllerList) {
for (auto* pController : std::as_const(controllerList)) {
pController->disconnect(this);
}
while (!m_controllerPages.isEmpty()) {
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions src/controllers/legacycontrollermapping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -23,7 +27,7 @@ void LegacyControllerMapping::loadSettings(UserSettingsPointer pConfig,
.arg(controllerName, controllerPath);

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

QList<QString> availableSettingKeys;
for (const auto& pSetting : std::as_const(availableSettings)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/dialog/dlgreplacecuecolor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void DlgReplaceCueColor::slotApply() {
}

// Flush cached tracks to database
QSet<TrackId> cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds();
const QSet<TrackId> cachedTrackIds = GlobalTrackCacheLocker().getCachedTrackIds();
for (const TrackId& trackId : cachedTrackIds) {
TrackPointer pTrack = GlobalTrackCacheLocker().lookupTrackById(trackId);
if (pTrack) {
Expand Down
4 changes: 2 additions & 2 deletions src/effects/effectslot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions src/effects/presets/effectpreset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ EffectPreset::EffectPreset(const EffectSlotPointer pEffectSlot)
for (int parameterTypeId = 0; parameterTypeId < numTypes; ++parameterTypeId) {
const EffectParameterType parameterType =
static_cast<EffectParameterType>(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));
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/library/banshee/bansheefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ void BansheeFeature::activate() {
m_isActivated = true;

std::unique_ptr<TreeItem> pRootItem = TreeItem::newRoot(this);
QList<BansheeDbConnection::Playlist> playlists = m_connection.getPlaylists();
for (const BansheeDbConnection::Playlist& playlist: playlists) {
const QList<BansheeDbConnection::Playlist> 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);
Expand Down
4 changes: 2 additions & 2 deletions src/library/dao/trackdao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ 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();

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

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

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

QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp,
const QStringList rawAndNodes = query.split(kSplitOnOrOperatorRegexp,
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
Qt::SkipEmptyParts);
#else
Expand Down
2 changes: 1 addition & 1 deletion src/library/trackcollection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ bool TrackCollection::purgeAllTracks(
const QDir& rootDir) {
DEBUG_ASSERT_QOBJECT_THREAD_AFFINITY(this);

QList<TrackRef> trackRefs = m_trackDao.getAllTrackRefs(rootDir);
const QList<TrackRef> trackRefs = m_trackDao.getAllTrackRefs(rootDir);
QList<TrackId> trackIds;
trackIds.reserve(trackRefs.size());
for (const auto& trackRef : trackRefs) {
Expand Down
2 changes: 1 addition & 1 deletion src/library/trackset/baseplaylistfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ void BasePlaylistFeature::slotAnalyzePlaylist() {
if (m_lastRightClickedIndex.isValid()) {
int playlistId = playlistIdFromIndex(m_lastRightClickedIndex);
if (playlistId >= 0) {
QList<TrackId> ids = m_playlistDao.getTrackIds(playlistId);
const QList<TrackId> ids = m_playlistDao.getTrackIds(playlistId);
QList<AnalyzerScheduledTrack> tracks;
for (auto id : ids) {
tracks.append(id);
Expand Down
2 changes: 1 addition & 1 deletion src/library/trackset/crate/cratefeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion src/musicbrainz/web/coverartarchiveimagetask.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions src/musicbrainz/web/musicbrainzrecordingstask.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ class MusicBrainzRecordingsTask : public network::WebTask {

signals:
void succeeded(
const QList<musicbrainz::TrackRelease>& trackReleases);
const QList<mixxx::musicbrainz::TrackRelease>& trackReleases);
void failed(
const network::WebResponse& response,
const mixxx::network::WebResponse& response,
int errorCode,
const QString& errorMessage);
void currentRecordingFetchedFromMusicBrainz();
Expand Down
2 changes: 1 addition & 1 deletion src/network/jsonwebtask.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/preferences/broadcastsettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/preferences/colorpaletteeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion src/qml/qmlplayerproxy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/skin/legacy/tooltips.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/soundio/sounddevicenetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ void SoundDeviceNetwork::writeProcess(SINT framesPerBuffer) {
m_outputFifo->aquireReadRegions(readAvailable,
&dataPtr1, &size1, &dataPtr2, &size2);

QVector<NetworkOutputStreamWorkerPtr> workers =
const QVector<NetworkOutputStreamWorkerPtr> workers =
m_pNetworkStream->outputWorkers();
for (const auto& pWorker : workers) {
if (pWorker.isNull()) {
Expand Down
2 changes: 1 addition & 1 deletion src/soundio/soundmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}

Expand Down
Loading

0 comments on commit 6efbf8c

Please sign in to comment.