warnings: Fix unused/unnecessary lambda capture

Change-Id: I1d0ed78da53c56f0a87bf35b1ee2480f9dfd330c
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Marcus Tillmanns
2022-08-04 11:27:27 +02:00
parent cd252e4d90
commit a251126485
3 changed files with 13 additions and 9 deletions

View File

@@ -473,7 +473,7 @@ ClangdClient::ClangdClient(Project *project, const Utils::FilePath &jsonDbDir)
}
});
connect(this, &Client::initialized, this, [this] {
connect(this, &Client::initialized, this, [] {
auto currentDocumentFilter = static_cast<ClangdCurrentDocumentFilter *>(
CppEditor::CppModelManager::instance()->currentDocumentFilter());
currentDocumentFilter->updateCurrentClient();

View File

@@ -304,7 +304,7 @@ CppEditor::BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDo
TextEditor::TextDocument *baseTextDocument)
{
const auto processor = new ClangEditorDocumentProcessor(baseTextDocument);
const auto handleConfigChange = [this](const Utils::FilePath &fp,
const auto handleConfigChange = [](const Utils::FilePath &fp,
const BaseEditorDocumentParser::Configuration &config) {
if (const auto client = clientForFile(fp))
client->updateParserConfig(fp, config);
@@ -598,7 +598,7 @@ void ClangModelManagerSupport::watchForExternalChanges()
void ClangModelManagerSupport::watchForInternalChanges()
{
connect(Core::DocumentManager::instance(), &Core::DocumentManager::filesChangedInternally,
this, [this](const Utils::FilePaths &filePaths) {
this, [](const Utils::FilePaths &filePaths) {
for (const Utils::FilePath &fp : filePaths) {
ClangdClient * const client = clientForFile(fp);
if (!client || client->documentForFilePath(fp))

View File

@@ -4528,6 +4528,13 @@ private:
class GenerateGettersSettersDialog : public QDialog
{
Q_DECLARE_TR_FUNCTIONS(GenerateGettersSettersDialog)
static constexpr CandidateTreeItem::Column CheckBoxColumn[4]
= {CandidateTreeItem::Column::GetterColumn,
CandidateTreeItem::Column::SetterColumn,
CandidateTreeItem::Column::SignalColumn,
CandidateTreeItem::Column::QPropertyColumn};
public:
GenerateGettersSettersDialog(const GetterSetterCandidates &candidates)
: QDialog()
@@ -4578,14 +4585,11 @@ public:
});
};
std::array<QCheckBox *, 4> checkBoxes = {};
constexpr Column CheckBoxColumn[4] = {Column::GetterColumn,
Column::SetterColumn,
Column::SignalColumn,
Column::QPropertyColumn};
static_assert(std::size(CheckBoxColumn) == checkBoxes.size(),
"Must contain the same number of elements");
for (std::size_t i = 0; i < checkBoxes.size(); ++i) {
if (Utils::anyOf(candidates, [i, CheckBoxColumn](const MemberInfo &mi) {
if (Utils::anyOf(candidates, [i](const MemberInfo &mi) {
return mi.possibleFlags & CandidateTreeItem::ColumnFlag[CheckBoxColumn[i]];
})) {
const Column column = CheckBoxColumn[i];
@@ -4601,7 +4605,7 @@ public:
createConnections(checkBoxes[i], column);
}
}
connect(model, &QAbstractItemModel::dataChanged, this, [this, checkBoxes, CheckBoxColumn] {
connect(model, &QAbstractItemModel::dataChanged, this, [this, checkBoxes] {
const auto countExisting = [this](Flags flag) {
return Utils::count(m_candidates, [flag](const MemberInfo &mi) {
return !(mi.possibleFlags & flag);