ProjectTree: Add an option to hide Source and Headers file groups

A new checkbox "Show Source and Header Groups" is added to
the filter menu in the project tree. It is checked by default.

Unchecking it removes the extra level of virtual folders containing
sources and headers.

Change-Id: I25f4514e7f1f6cdfcb531a911e54cc6e7e42a3e2
Fixes: QTCREATORBUG-25313
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Wojciech Smigaj
2021-01-27 21:54:32 +00:00
committed by hjk
parent 0bcab32657
commit 194569b471
7 changed files with 56 additions and 1 deletions

View File

@@ -43,6 +43,8 @@ std::unique_ptr<FolderNode> createCMakeVFolder(const Utils::FilePath &basePath,
auto newFolder = std::make_unique<VirtualFolderNode>(basePath);
newFolder->setPriority(priority);
newFolder->setDisplayName(displayName);
newFolder->setIsSourcesOrHeaders(displayName == "Source Files"
|| displayName == "Header Files");
return newFolder;
}