diff options
author | xerus2000 <27jf@pm.me> | 2020-11-13 21:35:08 +0100 |
---|---|---|
committer | xerus2000 <27jf@pm.me> | 2020-11-13 21:35:08 +0100 |
commit | 8e18c532f3bb04177093581f2ec1bc993225079e (patch) | |
tree | 56b4492feeaa7ca036de3b9cd91bc0e566c78d36 /src/widget | |
parent | 2d9dcff9256b8b092af0d6d89f94b797e441c95a (diff) | |
parent | 3a9048073bf045c40ae015d61634bf6248540ce2 (diff) |
Merge remote-tracking branch 'upstream/2.3' into cleanup-headers
Diffstat (limited to 'src/widget')
-rw-r--r-- | src/widget/wbasewidget.cpp | 26 | ||||
-rw-r--r-- | src/widget/weffectpushbutton.cpp | 15 | ||||
-rw-r--r-- | src/widget/wmainmenubar.cpp | 4 | ||||
-rw-r--r-- | src/widget/woverview.cpp | 4 | ||||
-rw-r--r-- | src/widget/wsplitter.cpp | 3 | ||||
-rw-r--r-- | src/widget/wtrackmenu.cpp | 3 | ||||
-rw-r--r-- | src/widget/wtracktableviewheader.cpp | 2 | ||||
-rw-r--r-- | src/widget/wwaveformviewer.cpp | 2 |
8 files changed, 32 insertions, 27 deletions
diff --git a/src/widget/wbasewidget.cpp b/src/widget/wbasewidget.cpp index 2900f253b6..0972867210 100644 --- a/src/widget/wbasewidget.cpp +++ b/src/widget/wbasewidget.cpp @@ -86,36 +86,36 @@ double WBaseWidget::getControlParameterDisplay() const { } void WBaseWidget::resetControlParameter() { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->resetControl(); } } void WBaseWidget::setControlParameter(double v) { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->setControlParameter(v); } } void WBaseWidget::setControlParameterUp(double v) { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->setControlParameterUp(v); } } void WBaseWidget::setControlParameterDown(double v) { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->setControlParameterDown(v); } } void WBaseWidget::setControlParameterLeftDown(double v) { if (!m_leftConnections.isEmpty()) { - for (ControlParameterWidgetConnection* pControlConnection : m_leftConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_leftConnections)) { pControlConnection->setControlParameterDown(v); } } else { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->setControlParameterDown(v); } } @@ -123,24 +123,24 @@ void WBaseWidget::setControlParameterLeftDown(double v) { void WBaseWidget::setControlParameterLeftUp(double v) { if (!m_leftConnections.isEmpty()) { - for (ControlParameterWidgetConnection* pControlConnection : m_leftConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_leftConnections)) { pControlConnection->setControlParameterUp(v); } } else { - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { pControlConnection->setControlParameterUp(v); } } } void WBaseWidget::setControlParameterRightDown(double v) { - for (ControlParameterWidgetConnection* pControlConnection : m_rightConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_rightConnections)) { pControlConnection->setControlParameterDown(v); } } void WBaseWidget::setControlParameterRightUp(double v) { - for (ControlParameterWidgetConnection* pControlConnection : m_rightConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_rightConnections)) { pControlConnection->setControlParameterUp(v); } } @@ -193,13 +193,13 @@ void WBaseWidget::fillDebugTooltip(QStringList* debug) { << QString("SizeHint: %1").arg(toDebugString(m_pWidget->sizeHint())) << QString("MinimumSizeHint: %1").arg(toDebugString(m_pWidget->minimumSizeHint())); - for (ControlParameterWidgetConnection* pControlConnection : m_leftConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_leftConnections)) { *debug << QString("LeftConnection: %1").arg(pControlConnection->toDebugString()); } - for (ControlParameterWidgetConnection* pControlConnection : m_rightConnections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_rightConnections)) { *debug << QString("RightConnection: %1").arg(pControlConnection->toDebugString()); } - for (ControlParameterWidgetConnection* pControlConnection : m_connections) { + for (ControlParameterWidgetConnection* pControlConnection : qAsConst(m_connections)) { *debug << QString("Connection: %1").arg(pControlConnection->toDebugString()); } if (m_pDisplayConnection) { diff --git a/src/widget/weffectpushbutton.cpp b/src/widget/weffectpushbutton.cpp index 540be261a1..58fceb97de 100644 --- a/src/widget/weffectpushbutton.cpp +++ b/src/widget/weffectpushbutton.cpp @@ -43,7 +43,8 @@ void WEffectPushButton::setEffectParameterSlot( void WEffectPushButton::onConnectedControlChanged(double dParameter, double dValue) { - for (const auto& action : m_pButtonMenu->actions()) { + const QList<QAction*> actions = m_pButtonMenu->actions(); + for (const auto& action : actions) { if (action->data().toDouble() == dValue) { action->setChecked(true); break; @@ -64,8 +65,9 @@ void WEffectPushButton::mousePressEvent(QMouseEvent* e) { // The push handler may have set the left value. Check the corresponding // QAction. - double leftValue = getControlParameterLeft(); - for (const auto& action : m_pButtonMenu->actions()) { + const double leftValue = getControlParameterLeft(); + const QList<QAction*> actions = m_pButtonMenu->actions(); + for (const auto& action : actions) { if (action->data().toDouble() == leftValue) { action->setChecked(true); break; @@ -79,8 +81,9 @@ void WEffectPushButton::mouseReleaseEvent(QMouseEvent* e) { // The release handler may have set the left value. Check the corresponding // QAction. - double leftValue = getControlParameterLeft(); - for (QAction* action : m_pButtonMenu->actions()) { + const double leftValue = getControlParameterLeft(); + const QList<QAction*> actions = m_pButtonMenu->actions(); + for (QAction* action : actions) { if (action->data().toDouble() == leftValue) { action->setChecked(true); break; @@ -119,7 +122,7 @@ void WEffectPushButton::parameterUpdated() { auto actionGroup = new QActionGroup(m_pButtonMenu); actionGroup->setExclusive(true); - for (const auto& option : options) { + for (const auto& option : qAsConst(options)) { // action is added automatically to actionGroup auto action = new QAction(actionGroup); // qDebug() << options[i].first; diff --git a/src/widget/wmainmenubar.cpp b/src/widget/wmainmenubar.cpp index cf7f01dc2c..c5ee65edf0 100644 --- a/src/widget/wmainmenubar.cpp +++ b/src/widget/wmainmenubar.cpp @@ -679,11 +679,11 @@ void WMainMenuBar::createVisibilityControl(QAction* pAction, void WMainMenuBar::onNumberOfDecksChanged(int decks) { int deck = 0; - for (QAction* pVinylControlEnabled : m_vinylControlEnabledActions) { + for (QAction* pVinylControlEnabled : qAsConst(m_vinylControlEnabledActions)) { pVinylControlEnabled->setVisible(deck++ < decks); } deck = 0; - for (QAction* pLoadToDeck : m_loadToDeckActions) { + for (QAction* pLoadToDeck : qAsConst(m_loadToDeckActions)) { pLoadToDeck->setVisible(deck++ < decks); } } diff --git a/src/widget/woverview.cpp b/src/widget/woverview.cpp index 1f24166425..595bfa5b91 100644 --- a/src/widget/woverview.cpp +++ b/src/widget/woverview.cpp @@ -384,7 +384,7 @@ void WOverview::onPassthroughChange(double v) { void WOverview::updateCues(const QList<CuePointer> &loadedCues) { m_marksToRender.clear(); - for (CuePointer currentCue: loadedCues) { + for (const CuePointer& currentCue : loadedCues) { const WaveformMarkPointer pMark = m_marks.getHotCueMark(currentCue->getHotCue()); if (pMark != nullptr && pMark->isValid() && pMark->isVisible() @@ -1096,7 +1096,7 @@ void WOverview::drawMarkLabels(QPainter* pPainter, const float offset, const flo QFontMetricsF fontMetrics(markerFont); // Draw WaveformMark labels - for (const auto& pMark : m_marksToRender) { + for (const auto& pMark : qAsConst(m_marksToRender)) { if (m_pHoveredMark != nullptr && pMark != m_pHoveredMark) { if (pMark->m_label.intersects(m_pHoveredMark->m_label)) { continue; diff --git a/src/widget/wsplitter.cpp b/src/widget/wsplitter.cpp index fca8eba3cf..4372f9d9a9 100644 --- a/src/widget/wsplitter.cpp +++ b/src/widget/wsplitter.cpp @@ -104,7 +104,8 @@ void WSplitter::setup(const QDomNode& node, const SkinContext& context) { void WSplitter::slotSplitterMoved() { if (!m_configKey.group.isEmpty() && !m_configKey.item.isEmpty()) { QStringList sizeStrList; - for (const int& sizeInt : sizes()) { + const auto sizesIntList = sizes(); + for (const int& sizeInt : sizesIntList) { sizeStrList.push_back(QString::number(sizeInt)); } QString sizesStr = sizeStrList.join(","); diff --git a/src/widget/wtrackmenu.cpp b/src/widget/wtrackmenu.cpp index e1d8a268f1..1130062081 100644 --- a/src/widget/wtrackmenu.cpp +++ b/src/widget/wtrackmenu.cpp @@ -385,7 +385,8 @@ void WTrackMenu::setupActions() { m_pMetadataMenu->addAction(m_pImportMetadataFromMusicBrainzAct); m_pMetadataMenu->addAction(m_pExportMetadataAct); - for (const auto& updateInExternalTrackCollection : m_updateInExternalTrackCollections) { + for (const auto& updateInExternalTrackCollection : + qAsConst(m_updateInExternalTrackCollections)) { ExternalTrackCollection* externalTrackCollection = updateInExternalTrackCollection.externalTrackCollection; if (externalTrackCollection) { diff --git a/src/widget/wtracktableviewheader.cpp b/src/widget/wtracktableviewheader.cpp index 99c613679c..f29697ccca 100644 --- a/src/widget/wtracktableviewheader.cpp +++ b/src/widget/wtracktableviewheader.cpp @@ -276,7 +276,7 @@ void WTrackTableViewHeader::showOrHideColumn(int column) { int WTrackTableViewHeader::hiddenCount() { int count = 0; - for (const auto& pAction : m_columnActions) { + for (const auto& pAction : qAsConst(m_columnActions)) { if (!pAction->isChecked()) { count += 1; } diff --git a/src/widget/wwaveformviewer.cpp b/src/widget/wwaveformviewer.cpp index 4dd5aa9e75..872959d3d7 100644 --- a/src/widget/wwaveformviewer.cpp +++ b/src/widget/wwaveformviewer.cpp @@ -262,7 +262,7 @@ void WWaveformViewer::setWaveformWidget(WaveformWidgetAbstract* waveformWidget) CuePointer WWaveformViewer::getCuePointerFromCueMark(WaveformMarkPointer pMark) const { if (pMark && pMark->getHotCue() != Cue::kNoHotCue) { - QList<CuePointer> cueList = m_waveformWidget->getTrackInfo()->getCuePoints(); + const QList<CuePointer> cueList = m_waveformWidget->getTrackInfo()->getCuePoints(); for (const auto& pCue : cueList) { if (pCue->getHotCue() == pMark->getHotCue()) { return pCue; |