forked from qt-creator/qt-creator
VcsBase: Pass context object to lambda connections
Remove some unneeded lambda () brackets. Change-Id: I20e43625793401544e86efb627f5921c395026bb Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -230,12 +230,12 @@ void BranchView::slotCustomContextMenu(const QPoint &point)
|
||||
contextMenu.addAction(Tr::tr("&Add..."), this, &BranchView::add);
|
||||
const std::optional<QString> remote = m_model->remoteName(index);
|
||||
if (remote.has_value()) {
|
||||
contextMenu.addAction(Tr::tr("&Fetch"), this, [this, &remote]() {
|
||||
contextMenu.addAction(Tr::tr("&Fetch"), this, [this, &remote] {
|
||||
GitClient::instance()->fetch(m_repository, *remote);
|
||||
});
|
||||
contextMenu.addSeparator();
|
||||
if (!remote->isEmpty()) {
|
||||
contextMenu.addAction(Tr::tr("Remove &Stale Branches"), this, [this, &remote]() {
|
||||
contextMenu.addAction(Tr::tr("Remove &Stale Branches"), this, [this, &remote] {
|
||||
GitClient::instance()->removeStaleRemoteBranches(m_repository, *remote);
|
||||
});
|
||||
contextMenu.addSeparator();
|
||||
|
||||
@@ -113,7 +113,7 @@ AuthenticationDialog::AuthenticationDialog(GerritServer *server)
|
||||
m_checkTimer = new QTimer(this);
|
||||
m_checkTimer->setSingleShot(true);
|
||||
connect(m_checkTimer, &QTimer::timeout, this, &AuthenticationDialog::checkCredentials);
|
||||
connect(m_passwordLineEdit, &QLineEdit::textChanged, [this]() {
|
||||
connect(m_passwordLineEdit, &QLineEdit::textChanged, this, [this] {
|
||||
if (QGuiApplication::clipboard()->text() == m_passwordLineEdit->text()) {
|
||||
checkCredentials();
|
||||
return;
|
||||
|
||||
@@ -114,10 +114,10 @@ GerritDialog::GerritDialog(const QSharedPointer<GerritParameters> &p,
|
||||
m_progressIndicator->attachToWidget(m_treeView->viewport());
|
||||
m_progressIndicator->hide();
|
||||
|
||||
m_displayButton = addActionButton(Git::Tr::tr("&Show"), [this]() { slotFetchDisplay(); });
|
||||
m_cherryPickButton = addActionButton(Git::Tr::tr("Cherry &Pick"), [this]() { slotFetchCherryPick(); });
|
||||
m_checkoutButton = addActionButton(Git::Tr::tr("C&heckout"), [this]() { slotFetchCheckout(); });
|
||||
m_refreshButton = addActionButton(Git::Tr::tr("&Refresh"), [this]() { refresh(); });
|
||||
m_displayButton = addActionButton(Git::Tr::tr("&Show"), [this] { slotFetchDisplay(); });
|
||||
m_cherryPickButton = addActionButton(Git::Tr::tr("Cherry &Pick"), [this] { slotFetchCherryPick(); });
|
||||
m_checkoutButton = addActionButton(Git::Tr::tr("C&heckout"), [this] { slotFetchCheckout(); });
|
||||
m_refreshButton = addActionButton(Git::Tr::tr("&Refresh"), [this] { refresh(); });
|
||||
m_refreshButton->setDefault(true);
|
||||
|
||||
using namespace Layouting;
|
||||
|
||||
@@ -250,7 +250,7 @@ void GerritPlugin::initialize(ActionContainer *ac)
|
||||
|
||||
m_pushToGerritCommand =
|
||||
ActionManager::registerAction(pushAction, Constants::GERRIT_PUSH);
|
||||
connect(pushAction, &QAction::triggered, this, [this]() { push(); });
|
||||
connect(pushAction, &QAction::triggered, this, [this] { push(); });
|
||||
ac->addAction(m_pushToGerritCommand);
|
||||
|
||||
auto options = new GerritOptionsPage(m_parameters, this);
|
||||
|
||||
@@ -207,13 +207,13 @@ public:
|
||||
QAction *copyToClipboardAction = new QAction;
|
||||
copyToClipboardAction->setIcon(QIcon::fromTheme("edit-copy", Utils::Icons::COPY.icon()));
|
||||
copyToClipboardAction->setToolTip(TextMark::tr("Copy SHA1 to Clipboard"));
|
||||
QObject::connect(copyToClipboardAction, &QAction::triggered, [info]() {
|
||||
QObject::connect(copyToClipboardAction, &QAction::triggered, [info] {
|
||||
Utils::setClipboardAndSelection(info.sha1);
|
||||
});
|
||||
QAction *showAction = new QAction;
|
||||
showAction->setIcon(Utils::Icons::ZOOM.icon());
|
||||
showAction->setToolTip(TextMark::tr("Show Commit %1").arg(info.sha1.left(8)));
|
||||
QObject::connect(showAction, &QAction::triggered, [info]() {
|
||||
QObject::connect(showAction, &QAction::triggered, [info] {
|
||||
GitClient::instance()->show(info.fileName, info.sha1);
|
||||
});
|
||||
return QList<QAction *>{copyToClipboardAction, showAction};
|
||||
@@ -669,7 +669,7 @@ QAction *GitPluginPrivate::createRepositoryAction(ActionContainer *ac, const QSt
|
||||
const Context &context, bool addToLocator,
|
||||
GitClientMemberFunc func, const QKeySequence &keys)
|
||||
{
|
||||
auto cb = [this, func]() -> void {
|
||||
auto cb = [this, func] {
|
||||
QTC_ASSERT(currentState().hasTopLevel(), return);
|
||||
(m_gitClient.*func)(currentState().topLevel());
|
||||
};
|
||||
@@ -1575,7 +1575,7 @@ void GitPluginPrivate::instantBlame()
|
||||
const VcsCommand *command = GitClient::instance()->vcsExec(
|
||||
workingDirectory, {"blame", "-p", "-L", lineString, "--", filePath.toString()},
|
||||
nullptr, false, RunFlags::NoOutput);
|
||||
connect(command, &VcsCommand::done, this, [command, filePath, line, this]() {
|
||||
connect(command, &VcsCommand::done, this, [command, filePath, line, this] {
|
||||
if (command->result() == ProcessResult::FinishedWithError &&
|
||||
command->cleanedStdErr().contains("no such path")) {
|
||||
disconnect(m_blameCursorPosConn);
|
||||
|
||||
@@ -76,7 +76,7 @@ LogChangeWidget::LogChangeWidget(QWidget *parent)
|
||||
setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
setActivationMode(Utils::DoubleClickActivation);
|
||||
connect(this, &LogChangeWidget::activated, this, &LogChangeWidget::emitCommitActivated);
|
||||
QTimer::singleShot(0, [this] { setFocus(); });
|
||||
QTimer::singleShot(0, this, [this] { setFocus(); });
|
||||
}
|
||||
|
||||
bool LogChangeWidget::init(const FilePath &repository, const QString &commit, LogFlags flags)
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
Span(2, buttonBox)
|
||||
}.attachTo(this);
|
||||
|
||||
connect(m_nameEdit, &QLineEdit::textChanged, [this, buttonBox] {
|
||||
connect(m_nameEdit, &QLineEdit::textChanged, this, [this, buttonBox] {
|
||||
buttonBox->button(QDialogButtonBox::Ok)->setEnabled(m_nameEdit->isValid());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user