From d38ef93ec9aa521cd4292f80845b3ab1a5cd05f0 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Wed, 8 Jan 2020 02:43:47 +0100 Subject: [PATCH] Pass context object as third parameter to connect() call --- src/controllers/dlgprefcontrollers.cpp | 2 +- src/effects/effectchainslot.cpp | 2 +- src/errordialoghandler.cpp | 2 +- src/library/autodj/autodjfeature.cpp | 2 +- src/widget/wmainmenubar.cpp | 14 ++++++------- src/widget/wtracktableview.cpp | 28 +++++++++++++------------- src/widget/wtracktableviewheader.cpp | 2 +- src/widget/wwidgetstack.cpp | 4 ++-- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/controllers/dlgprefcontrollers.cpp b/src/controllers/dlgprefcontrollers.cpp index 5217b55cbc29..0eb7bf5da0e0 100644 --- a/src/controllers/dlgprefcontrollers.cpp +++ b/src/controllers/dlgprefcontrollers.cpp @@ -20,7 +20,7 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences, setupControllerWidgets(); connect(btnOpenUserPresets, &QPushButton::clicked, - [this] { slotOpenLocalFile(userPresetsPath(m_pConfig)); }); + this, [this] { slotOpenLocalFile(userPresetsPath(m_pConfig)); }); // Connections connect(m_pControllerManager, SIGNAL(devicesChanged()), diff --git a/src/effects/effectchainslot.cpp b/src/effects/effectchainslot.cpp index cdea996268b9..ce6aeb1e90c5 100644 --- a/src/effects/effectchainslot.cpp +++ b/src/effects/effectchainslot.cpp @@ -328,7 +328,7 @@ void EffectChainSlot::registerInputChannel(const ChannelHandleAndGroup& handle_g ChannelInfo* pInfo = new ChannelInfo(handle_group, pEnableControl); m_channelInfoByName[handle_group.name()] = pInfo; connect(pEnableControl, &ControlPushButton::valueChanged, - [this, handle_group] { slotChannelStatusChanged(handle_group.name()); }); + this, [this, handle_group] { slotChannelStatusChanged(handle_group.name()); }); } diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 8a57542be576..baddcc8a449a 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -180,7 +180,7 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { // Signal mapper calls our slot with the key parameter so it knows which to // remove from the list connect(msgBox, &QMessageBox::finished, - [this, &props, &msgBox] { boxClosed(props->m_key, msgBox); }); + this, [this, &props, &msgBox] { boxClosed(props->m_key, msgBox); }); locker.unlock(); diff --git a/src/library/autodj/autodjfeature.cpp b/src/library/autodj/autodjfeature.cpp index db7dcae5fb12..70c6c8d25001 100644 --- a/src/library/autodj/autodjfeature.cpp +++ b/src/library/autodj/autodjfeature.cpp @@ -302,7 +302,7 @@ void AutoDJFeature::onRightClickChild(const QPoint& globalPos, while (nonAutoDjCrates.populateNext(&crate)) { auto pAction = std::make_unique(crate.getName(), &crateMenu); connect(pAction.get(), &QAction::triggered, - [this, crate] { slotAddCrateToAutoDj(crate.getId().value()); }); + this, [this, crate] { slotAddCrateToAutoDj(crate.getId().value()); }); crateMenu.addAction(pAction.get()); pAction.release(); } diff --git a/src/widget/wmainmenubar.cpp b/src/widget/wmainmenubar.cpp index 65d1a50f9468..97ddb17fd06c 100644 --- a/src/widget/wmainmenubar.cpp +++ b/src/widget/wmainmenubar.cpp @@ -85,7 +85,7 @@ void WMainMenuBar::initialize() { // WMainMenuBar::onNumberOfDecksChanged. pFileLoadSongToPlayer->setVisible(false); connect(pFileLoadSongToPlayer, &QAction::triggered, - [this, deck] { loadTrackToDeck(deck + 1); }); + this, [this, deck] { loadTrackToDeck(deck + 1); }); pFileMenu->addAction(pFileLoadSongToPlayer); m_loadToDeckActions.push_back(pFileLoadSongToPlayer); @@ -309,7 +309,7 @@ void WMainMenuBar::initialize() { vc_checkbox->setWhatsThis(buildWhatsThis(vinylControlTitle, vinylControlText)); connect(vc_checkbox, &QAction::triggered, - [this, i] { toggleVinylControl(i); }); + this, [this, i] { toggleVinylControl(i); }); pVinylControlMenu->addAction(vc_checkbox); } pOptionsMenu->addMenu(pVinylControlMenu); @@ -501,7 +501,7 @@ void WMainMenuBar::initialize() { pHelpSupport->setStatusTip(supportText); pHelpSupport->setWhatsThis(buildWhatsThis(supportTitle, supportText)); connect(pHelpSupport, &QAction::triggered, - [this] { slotVisitUrl(MIXXX_SUPPORT_URL); }); + this, [this] { slotVisitUrl(MIXXX_SUPPORT_URL); }); pHelpMenu->addAction(pHelpSupport); QDir resourceDir(m_pConfig->getResourcePath()); @@ -532,7 +532,7 @@ void WMainMenuBar::initialize() { pHelpManual->setStatusTip(manualText); pHelpManual->setWhatsThis(buildWhatsThis(manualTitle, manualText)); connect(pHelpManual, &QAction::triggered, - [this, qManualUrl] { slotVisitUrl(qManualUrl.toString()); }); + this, [this, qManualUrl] { slotVisitUrl(qManualUrl.toString()); }); pHelpMenu->addAction(pHelpManual); QString shortcutsTitle = tr("&Keyboard Shortcuts") + externalLinkSuffix; @@ -541,7 +541,7 @@ void WMainMenuBar::initialize() { pHelpShortcuts->setStatusTip(shortcutsText); pHelpShortcuts->setWhatsThis(buildWhatsThis(shortcutsTitle, shortcutsText)); connect(pHelpShortcuts, &QAction::triggered, - [this] { slotVisitUrl(MIXXX_SHORTCUTS_URL); }); + this, [this] { slotVisitUrl(MIXXX_SHORTCUTS_URL); }); pHelpMenu->addAction(pHelpShortcuts); QString feedbackTitle = tr("Send Us &Feedback") + externalLinkSuffix; @@ -550,7 +550,7 @@ void WMainMenuBar::initialize() { pHelpFeedback->setStatusTip(feedbackText); pHelpFeedback->setWhatsThis(buildWhatsThis(feedbackTitle, feedbackText)); connect(pHelpFeedback, &QAction::triggered, - [this] { slotVisitUrl(MIXXX_FEEDBACK_URL); }); + this, [this] { slotVisitUrl(MIXXX_FEEDBACK_URL); }); pHelpMenu->addAction(pHelpFeedback); QString translateTitle = tr("&Translate This Application") + externalLinkSuffix; @@ -559,7 +559,7 @@ void WMainMenuBar::initialize() { pHelpTranslation->setStatusTip(translateText); pHelpTranslation->setWhatsThis(buildWhatsThis(translateTitle, translateText)); connect(pHelpTranslation, &QAction::triggered, - [this] { slotVisitUrl(MIXXX_TRANSLATION_URL); }); + this, [this] { slotVisitUrl(MIXXX_TRANSLATION_URL); }); pHelpMenu->addAction(pHelpTranslation); pHelpMenu->addSeparator(); diff --git a/src/widget/wtracktableview.cpp b/src/widget/wtracktableview.cpp index 91a3991f3ecf..0874e419a932 100644 --- a/src/widget/wtracktableview.cpp +++ b/src/widget/wtracktableview.cpp @@ -482,7 +482,7 @@ void WTrackTableView::createActions() { m_updateInExternalTrackCollections += updateInExternalTrackCollection; auto externalTrackCollectionPtr = updateInExternalTrackCollection.externalTrackCollection; connect(updateInExternalTrackCollection.action, &QAction::triggered, - [=](){ + this, [=](){ slotUpdateExternalTrackCollection(externalTrackCollectionPtr);}); } @@ -490,7 +490,7 @@ void WTrackTableView::createActions() { // currently there is only one preview deck so just map it here. QString previewDeckGroup = PlayerManager::groupForPreviewDeck(0); connect(m_pAddToPreviewDeck, &QAction::triggered, - [this, previewDeckGroup] { loadSelectionToGroup(previewDeckGroup); }); + this, [this, previewDeckGroup] { loadSelectionToGroup(previewDeckGroup); }); // Clear metadata actions @@ -555,17 +555,17 @@ void WTrackTableView::createActions() { m_pBpmThreeHalvesAction = new QAction(tr("3/2 BPM"), this); connect(m_pBpmDoubleAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::DOUBLE); }); + this, [this] { slotScaleBpm(Beats::DOUBLE); }); connect(m_pBpmHalveAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::HALVE); }); + this, [this] { slotScaleBpm(Beats::HALVE); }); connect(m_pBpmTwoThirdsAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::TWOTHIRDS); }); + this, [this] { slotScaleBpm(Beats::TWOTHIRDS); }); connect(m_pBpmThreeFourthsAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::THREEFOURTHS); }); + this, [this] { slotScaleBpm(Beats::THREEFOURTHS); }); connect(m_pBpmFourThirdsAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::FOURTHIRDS); }); + this, [this] { slotScaleBpm(Beats::FOURTHIRDS); }); connect(m_pBpmThreeHalvesAction, &QAction::triggered, - [this] { slotScaleBpm(Beats::THREEHALVES); }); + this, [this] { slotScaleBpm(Beats::THREEHALVES); }); } // slot @@ -848,7 +848,7 @@ void WTrackTableView::contextMenuEvent(QContextMenuEvent* event) { pAction->setEnabled(deckEnabled); m_pDeckMenu->addAction(pAction); connect(pAction, &QAction::triggered, - [this, deckGroup] { loadSelectionToGroup(deckGroup); }); + this, [this, deckGroup] { loadSelectionToGroup(deckGroup); }); } } m_pLoadToMenu->addMenu(m_pDeckMenu); @@ -868,7 +868,7 @@ void WTrackTableView::contextMenuEvent(QContextMenuEvent* event) { pAction->setEnabled(samplerEnabled); m_pSamplerMenu->addAction(pAction); connect(pAction, &QAction::triggered, - [this, samplerGroup] {loadSelectionToGroup(samplerGroup); } ); + this, [this, samplerGroup] {loadSelectionToGroup(samplerGroup); } ); } m_pLoadToMenu->addMenu(m_pSamplerMenu); @@ -1628,7 +1628,7 @@ void WTrackTableView::slotPopulatePlaylistMenu() { pAction->setEnabled(!locked); m_pPlaylistMenu->addAction(pAction); connect(pAction, &QAction::triggered, - [this, it] { addSelectionToPlaylist(it.value()); }); + this, [this, it] { addSelectionToPlaylist(it.value()); }); } } @@ -1636,7 +1636,7 @@ void WTrackTableView::slotPopulatePlaylistMenu() { QAction* newPlaylistAction = new QAction(tr("Create New Playlist"), m_pPlaylistMenu); m_pPlaylistMenu->addAction(newPlaylistAction); connect(newPlaylistAction, &QAction::triggered, - [this] { addSelectionToPlaylist(-1); }); + this, [this] { addSelectionToPlaylist(-1); }); m_bPlaylistMenuLoaded = true; } @@ -1740,9 +1740,9 @@ void WTrackTableView::slotPopulateCrateMenu() { m_pCrateMenu->addAction(pAction.get()); connect(pAction.get(), &QAction::triggered, - [this, &pCheckBox] { updateSelectionCrates(pCheckBox.get()); }); + this, [this, &pCheckBox] { updateSelectionCrates(pCheckBox.get()); }); connect(pCheckBox.get(), &QCheckBox::stateChanged, - [this, &pCheckBox] { updateSelectionCrates(pCheckBox.get()); }); + this, [this, &pCheckBox] { updateSelectionCrates(pCheckBox.get()); }); } m_pCrateMenu->addSeparator(); diff --git a/src/widget/wtracktableviewheader.cpp b/src/widget/wtracktableviewheader.cpp index 6603e70ca2f7..5ef19d6028d3 100644 --- a/src/widget/wtracktableviewheader.cpp +++ b/src/widget/wtracktableviewheader.cpp @@ -169,7 +169,7 @@ void WTrackTableViewHeader::setModel(QAbstractItemModel* model) { // Map this action's signals m_columnActions.insert(i, action); connect(action, &QAction::triggered, - [this, i] { showOrHideColumn(i); }); + this, [this, i] { showOrHideColumn(i); }); m_menu.addAction(action); // force the section size to be a least WTTVH_MINIMUM_SECTION_SIZE diff --git a/src/widget/wwidgetstack.cpp b/src/widget/wwidgetstack.cpp index d0013975758c..6817a7a91079 100644 --- a/src/widget/wwidgetstack.cpp +++ b/src/widget/wwidgetstack.cpp @@ -141,9 +141,9 @@ void WWidgetStack::addWidgetWithControl(QWidget* pWidget, ControlObject* pContro } pListener->onCurrentWidgetChanged(currentIndex()); connect(pListener, &WidgetStackControlListener::switchToWidget, - [this, index] { showIndex(index); }); + this, [this, index] { showIndex(index); }); connect(pListener, &WidgetStackControlListener::hideWidget, - [this, index] { hideIndex(index); }); + this, [this, index] { hideIndex(index); }); connect(this, &WWidgetStack::currentChanged, pListener, &WidgetStackControlListener::onCurrentWidgetChanged); }