Commit 155f033f authored by Christian Kandeler's avatar Christian Kandeler

QbsProjectManager: Add Qt resource files as nodes.

Like the QmakeProjectManager does.

Change-Id: I99c42dd93b87f7fce45e6af8a5f6802a2035ad93
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent ccb6d613
......@@ -39,6 +39,7 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtsupportconstants.h>
#include <resourceeditor/resourcenode.h>
#include <utils/algorithm.h>
#include <utils/hostosinfo.h>
#include <utils/qtcassert.h>
......@@ -484,10 +485,11 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
foreach (FileTreeNode *c, fileTree->children) {
Utils::FileName path = Utils::FileName::fromString(c->path());
const ProjectExplorer::FileType newFileType = fileType(group, c->path());
const bool isQrcFile = newFileType == ProjectExplorer::ResourceType;
// Handle files:
if (c->isFile()) {
const ProjectExplorer::FileType newFileType = fileType(group, c->path());
if (c->isFile() && !isQrcFile) {
ProjectExplorer::FileNode *fn = 0;
foreach (ProjectExplorer::FileNode *f, root->fileNodes()) {
// There can be one match only here!
......@@ -514,10 +516,15 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
fn = f;
break;
}
using ResourceEditor::ResourceTopLevelNode;
if (!fn) {
fn = new QbsFolderNode(Utils::FileName::fromString(c->path()),
ProjectExplorer::FolderNodeType,
displayNameFromPath(c->path(), baseDir));
if (isQrcFile) {
fn = new ResourceTopLevelNode(Utils::FileName::fromString(c->path()), root);
} else {
fn = new QbsFolderNode(Utils::FileName::fromString(c->path()),
ProjectExplorer::FolderNodeType,
displayNameFromPath(c->path(), baseDir));
}
root->addFolderNodes(QList<FolderNode *>() << fn);
} else {
foldersToRemove.removeOne(fn);
......@@ -526,7 +533,11 @@ void QbsGroupNode::setupFolder(ProjectExplorer::FolderNode *root, const qbs::Gro
fn->setDisplayName(displayNameFromPath(c->path(), baseDir));
}
setupFolder(fn, group, c, c->path(), updateExisting);
if (isQrcFile)
static_cast<ResourceTopLevelNode *>(fn)->update();
else
setupFolder(fn, group, c, c->path(), updateExisting);
}
}
root->removeFileNodes(filesToRemove);
......
......@@ -41,6 +41,7 @@ QtcPlugin {
Depends { name: "ProjectExplorer" }
Depends { name: "Core" }
Depends { name: "CppTools" }
Depends { name: "ResourceEditor" }
Depends { name: "QtSupport" }
Depends { name: "QmlJSTools" }
......
......@@ -8,4 +8,5 @@ QTC_PLUGIN_DEPENDS += \
projectexplorer \
cpptools \
qtsupport \
qmljstools
qmljstools \
resourceeditor
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