aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-05-05 15:59:59 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-05-08 12:55:39 +0000
commit63e395c876b6d2de74c48dd287c04d037b4e26a1 (patch)
tree8ec5f639ed782fa8675708c738abccaf75ca5104
parentd056df2c15f0158b7076770fc2cb56cb843b3370 (diff)
QbsProjectManager: Fix object files appearing in locator
This bug got re-introduced by commit fc5ce1e710. Task-number: QTCREATORBUG-17382 Change-Id: I6114ca8f4305b3c0e356f4849094ecb1ccca7601 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
-rw-r--r--src/plugins/projectexplorer/projectnodes.h3
-rw-r--r--src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp18
2 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h
index dc03cd5aec..7c440b7355 100644
--- a/src/plugins/projectexplorer/projectnodes.h
+++ b/src/plugins/projectexplorer/projectnodes.h
@@ -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);
private:
diff --git a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp
index bc4bd6504e..bc3731f625 100644
--- a/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp
+++ b/src/plugins/qbsprojectmanager/qbsnodetreebuilder.cpp
@@ -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("linkerscript"),
+ QLatin1String("qrc"), QLatin1String("java.java")
+ };
+ ProjectExplorer::FileNode * const node
+ = new ProjectExplorer::FileNode(path, type, isGenerated);
+ node->setListInProject(!isGenerated || ad.fileTags().toSet().intersects(sourceTags));
+ root->addNestedNode(node);
+ }
root->compress();
}