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:
Jarek Kobus
2022-12-07 20:48:38 +01:00
parent 0d74be319a
commit 0313470db0
14 changed files with 26 additions and 27 deletions

View File

@@ -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);