diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index 12191b05cbd..0898fd78cfa 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -702,7 +702,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) { auto *action = new QAction(tr("No tag"), tagMenu); tagMenu->addAction(action); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [=, this]() { tagSelectedItems(QString()); }); } @@ -710,7 +710,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) for (const QString& tagstr : currentProject->getTags()) { auto *action = new QAction(tagstr, tagMenu); tagMenu->addAction(action); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [=, this]() { tagSelectedItems(tagstr); }); } diff --git a/lib/pathmatch.cpp b/lib/pathmatch.cpp index b7d78f048df..5dd11e1d755 100644 --- a/lib/pathmatch.cpp +++ b/lib/pathmatch.cpp @@ -33,7 +33,7 @@ PathMatch::PathMatch(std::vector patterns, std::string basepath, Sy bool PathMatch::match(const std::string &path, Filemode mode) const { - return std::any_of(mPatterns.cbegin(), mPatterns.cend(), [=] (const std::string &pattern) { + return std::any_of(mPatterns.cbegin(), mPatterns.cend(), [&] (const std::string &pattern) { return match(pattern, path, mBasepath, mode, mSyntax); }); }