From c43ee0885cd2e96801322b1c9e30c9de65501e6d Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Fri, 6 Oct 2023 19:17:18 +0200 Subject: [PATCH] SelectableFilesModel: Remove redundant variable Change-Id: I259ab5e918aa5fd8a12f08bdd683b2f8392f20ac Reviewed-by: Reviewed-by: hjk --- src/plugins/projectexplorer/selectablefilesmodel.cpp | 5 ++--- src/plugins/projectexplorer/selectablefilesmodel.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/plugins/projectexplorer/selectablefilesmodel.cpp b/src/plugins/projectexplorer/selectablefilesmodel.cpp index d7da1ad1f6d..7eef9c3ff41 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.cpp +++ b/src/plugins/projectexplorer/selectablefilesmodel.cpp @@ -38,7 +38,6 @@ SelectableFilesModel::SelectableFilesModel(QObject *parent) : QAbstractItemModel void SelectableFilesModel::setInitialMarkedFiles(const Utils::FilePaths &files) { m_files = Utils::toSet(files); - m_allFiles = files.isEmpty(); } void SelectableFilesFromDirModel::startParsing(const Utils::FilePath &baseDir) @@ -136,8 +135,8 @@ void SelectableFilesFromDirModel::buildTree(const Utils::FilePath &baseDir, Tree auto t = new Tree; t->parent = tree; t->name = fileInfo.fileName(); - FilterState state = filter(t); - t->checked = ((m_allFiles && state == FilterState::CHECKED) + const FilterState state = filter(t); + t->checked = ((m_files.isEmpty() && state == FilterState::CHECKED) || m_files.contains(fn)) ? Qt::Checked : Qt::Unchecked; t->fullPath = fn; t->isDir = false; diff --git a/src/plugins/projectexplorer/selectablefilesmodel.h b/src/plugins/projectexplorer/selectablefilesmodel.h index 38553c375ac..b8ce51111ed 100644 --- a/src/plugins/projectexplorer/selectablefilesmodel.h +++ b/src/plugins/projectexplorer/selectablefilesmodel.h @@ -121,7 +121,6 @@ private: void selectAllFiles(Tree *root); protected: - bool m_allFiles = true; QSet m_outOfBaseDirFiles; QSet m_files; Tree *m_root = nullptr;