Commit 7da95de7 authored by Christian Kandeler's avatar Christian Kandeler
Browse files

QbsProjectManager: Take the file type into account...

...when rebuilding the project tree.

Consider this product:
CppApplication { files: ["form.ui"] }

Now change it to this:
QtGuiApplication { files: ["form.ui"] }

The qbs file tags will now include "ui", so the Qt Creator
file type must change from "UnknownFileType" to "FormType". Therefore,
we need to replace the respective file node in the tree.

Change-Id: I6aa7e66d1af584e8ded2ffbb9b1215e8fc1135b8
Reviewed-by: default avatarJoerg Bornemann <>
parent 941356be
......@@ -519,10 +519,11 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
// Handle files:
if (c->isFile()) {
const ProjectExplorer::FileType newFileType = fileType(group, c->path());
ProjectExplorer::FileNode *fn = 0;
foreach (ProjectExplorer::FileNode *f, root->fileNodes()) {
// There can be one match only here!
if (f->path() != path)
if (f->path() != path || f->fileType() != newFileType)
fn = f;
......@@ -532,7 +533,7 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
if (updateExisting)
} else {
fn = new ProjectExplorer::FileNode(path, fileType(group, c->path()), false);
fn = new ProjectExplorer::FileNode(path, newFileType, false);
Supports Markdown
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