diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2017-05-03 12:45:38 +0200 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2017-05-04 09:16:47 +0000 |
commit | b0f1aa98a853062b7e0ead1414ae8970242dd25f (patch) | |
tree | f1e2b6da6fdcefcead537064a4fbe2a2dde5ea3a /src/plugins/resourceeditor | |
parent | 45930926494358fc22ad7375a07492b154020c4d (diff) | |
download | qt-creator-b0f1aa98a853062b7e0ead1414ae8970242dd25f.tar.gz |
ResourceTopLevelNode: Enable marking this node as generated
Change-Id: I298d405cd3f1a822949619beb6a0eae59dcfc143
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.cpp | 3 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.cpp | 7 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.h | 3 |
3 files changed, 8 insertions, 5 deletions
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(); |