Commit 63e395c8 authored by Christian Kandeler's avatar Christian Kandeler

QbsProjectManager: Fix object files appearing in locator

This bug got re-introduced by commit fc5ce1e7.

Task-number: QTCREATORBUG-17382
Change-Id: I6114ca8f4305b3c0e356f4849094ecb1ccca7601
Reviewed-by: Tobias Hunger's avatarTobias Hunger <>
parent d056df2c
......@@ -149,6 +149,8 @@ public:
static bool sortByPath(const Node *a, const Node *b);
void setParentFolderNode(FolderNode *parentFolder);
void setListInProject(bool l);
static FileType fileTypeForMimeType(const Utils::MimeType &mt);
static FileType fileTypeForFileName(const Utils::FileName &file);
......@@ -156,7 +158,6 @@ protected:
Node(NodeType nodeType, const Utils::FileName &filePath, int line = -1);
void setPriority(int priority);
void setListInProject(bool l);
void setIsGenerated(bool g);
......@@ -59,9 +59,23 @@ void setupArtifacts(ProjectExplorer::FolderNode *root, const QList<qbs::Artifact
const Utils::FileName path = Utils::FileName::fromString(ad.filePath());
const ProjectExplorer::FileType type = fileType(ad);
const bool isGenerated = ad.isGenerated();
root->addNestedNode(new ProjectExplorer::FileNode(path, type, isGenerated));
// A list of human-readable file types that we can reasonably expect
// to get generated during a build. Extend as needed.
static const QSet<QString> sourceTags = {
QLatin1String("c"), QLatin1String("cpp"), QLatin1String("hpp"),
QLatin1String("objc"), QLatin1String("objcpp"),
QLatin1String("c_pch_src"), QLatin1String("cpp_pch_src"),
QLatin1String("objc_pch_src"), QLatin1String("objcpp_pch_src"),
QLatin1String("asm"), QLatin1String("asm_cpp"),
QLatin1String("qrc"), QLatin1String("")
ProjectExplorer::FileNode * const node
= new ProjectExplorer::FileNode(path, type, isGenerated);
node->setListInProject(!isGenerated || ad.fileTags().toSet().intersects(sourceTags));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment