summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2017-05-03 12:45:38 +0200
committerTobias Hunger <tobias.hunger@qt.io>2017-05-04 09:16:47 +0000
commitb0f1aa98a853062b7e0ead1414ae8970242dd25f (patch)
treef1e2b6da6fdcefcead537064a4fbe2a2dde5ea3a
parent45930926494358fc22ad7375a07492b154020c4d (diff)
downloadqt-creator-b0f1aa98a853062b7e0ead1414ae8970242dd25f.tar.gz
ResourceTopLevelNode: Enable marking this node as generated
Change-Id: I298d405cd3f1a822949619beb6a0eae59dcfc143 Reviewed-by: hjk <hjk@qt.io>
-rw-r--r--src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp3
-rw-r--r--src/plugins/resourceeditor/resourceeditorplugin.cpp3
-rw-r--r--src/plugins/resourceeditor/resourcenode.cpp7
-rw-r--r--src/plugins/resourceeditor/resourcenode.h3
4 files changed, 10 insertions, 6 deletions
diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp
index 2bc3b23682..0e66a71674 100644
--- a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp
+++ b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp
@@ -168,7 +168,8 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node)
// If the cumulative evaluation botched the file too much, try the exact one.
if (contents.isEmpty())
vfs->readVirtualFile(file.toString(), QMakeVfs::VfsExact, &contents);
- auto resourceNode = new ResourceEditor::ResourceTopLevelNode(file, contents, vfolder);
+ auto resourceNode
+ = new ResourceEditor::ResourceTopLevelNode(file, false, contents, vfolder);
vfolder->addNode(resourceNode);
}
} else {
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp
index 1ae83161ca..42a59226b7 100644
--- a/src/plugins/resourceeditor/resourceeditorplugin.cpp
+++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp
@@ -222,7 +222,8 @@ void ResourceEditorPlugin::extensionsInitialized()
FolderNode *const pn = file->parentFolderNode();
QTC_ASSERT(pn, continue);
const Utils::FileName path = file->filePath();
- pn->replaceSubtree(file, new ResourceTopLevelNode(path, QString(), pn));
+ pn->replaceSubtree(file, new ResourceTopLevelNode(path, file->isGenerated(),
+ QString(), pn));
}
});
}
diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp
index cdf418ec43..b8fbcc10cb 100644
--- a/src/plugins/resourceeditor/resourcenode.cpp
+++ b/src/plugins/resourceeditor/resourcenode.cpp
@@ -70,7 +70,7 @@ public:
{
if (type == TypePermissions)
return true;
- auto newNode = new ResourceTopLevelNode(m_node->filePath(), m_node->contents(),
+ auto newNode = new ResourceTopLevelNode(m_node->filePath(), false, m_node->contents(),
m_node->parentFolderNode());
m_node->parentFolderNode()->replaceSubtree(m_node, newNode);
return true;
@@ -263,10 +263,11 @@ bool SimpleResourceFolderNode::renameFile(const QString &filePath, const QString
} // Internal
-ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, const QString &contents,
- FolderNode *parent)
+ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, bool generated,
+ const QString &contents, FolderNode *parent)
: FolderNode(filePath)
{
+ setIsGenerated(generated);
setIcon(FileIconProvider::icon(filePath.toString()));
if (contents.isEmpty()) {
m_document = new ResourceFileWatcher(this);
diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h
index 0d6b7a1b64..f1377eaa14 100644
--- a/src/plugins/resourceeditor/resourcenode.h
+++ b/src/plugins/resourceeditor/resourcenode.h
@@ -34,7 +34,8 @@ namespace Internal { class ResourceFileWatcher; }
class RESOURCE_EXPORT ResourceTopLevelNode : public ProjectExplorer::FolderNode
{
public:
- ResourceTopLevelNode(const Utils::FileName &filePath, const QString &contents, FolderNode *parent);
+ ResourceTopLevelNode(const Utils::FileName &filePath, bool generated,
+ const QString &contents, FolderNode *parent);
~ResourceTopLevelNode() override;
void addInternalNodes();