From 59c1fae60b2c74559e65934f208b5d3edbb3ecd1 Mon Sep 17 00:00:00 2001 From: Jarek Kobus Date: Mon, 3 Apr 2023 11:47:19 +0200 Subject: DirectoryFilter: Hide public methods Make most of the public methods of DirectoryFilter protected. Move connection to project manager signals into AllProjectFilesFilter c'tor. Remove unused DirectoryFilter::directories(). Change-Id: I66d16c2c90188de6a03fb072fed6c87ea3d9ce4c Reviewed-by: Eike Ziller Reviewed-by: Qt CI Bot Reviewed-by: --- src/plugins/projectexplorer/projectexplorer.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'src/plugins/projectexplorer') diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index cbf467349a..7e4938a204 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -863,16 +863,6 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er connect(SessionManager::instance(), &SessionManager::sessionLoaded, dd, &ProjectExplorerPluginPrivate::loadSesssionTasks); - connect(sessionManager, &ProjectManager::projectAdded, dd, [](ProjectExplorer::Project *project) { - dd->m_allProjectDirectoriesFilter.addDirectory(project->projectDirectory()); - }); - connect(sessionManager, - &ProjectManager::projectRemoved, - dd, - [](ProjectExplorer::Project *project) { - dd->m_allProjectDirectoriesFilter.removeDirectory(project->projectDirectory()); - }); - ProjectTree *tree = &dd->m_projectTree; connect(tree, &ProjectTree::currentProjectChanged, dd, [] { dd->updateContextMenuActions(ProjectTree::currentNode()); @@ -4371,6 +4361,15 @@ AllProjectFilesFilter::AllProjectFilesFilter() "Matches all files from all project directories. Append \"+\" or " "\":\" to jump to the given line number. Append another " "\"+\" or \":\" to jump to the column number as well.")); + + ProjectManager *projectManager = ProjectManager::instance(); + QTC_ASSERT(projectManager, return); + connect(projectManager, &ProjectManager::projectAdded, this, [this](Project *project) { + addDirectory(project->projectDirectory()); + }); + connect(projectManager, &ProjectManager::projectRemoved, this, [this](Project *project) { + removeDirectory(project->projectDirectory()); + }); } const char kDirectoriesKey[] = "directories"; -- cgit v1.2.1