diff options
author | hjk <hjk@qt.io> | 2019-02-26 08:24:16 +0100 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-02-26 13:37:16 +0000 |
commit | 0b593951d0cf9108c1ad5a9e0451c27ea7914944 (patch) | |
tree | fa27c585d1af7c246573a937f19204dc97fb8960 /src/plugins/resourceeditor | |
parent | 5cc1aee7ff9f651835524e86c26414f4526a992a (diff) |
ResourceEditor: Use Node::setIsGenerated setter
Change-Id: I51029f4d92b6959da363dc9f4f5efddf63c57894
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/resourceeditor')
-rw-r--r-- | src/plugins/resourceeditor/resourceeditorplugin.cpp | 5 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.cpp | 5 | ||||
-rw-r--r-- | src/plugins/resourceeditor/resourcenode.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index 4c7efeca47..c7de69cb63 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -217,8 +217,9 @@ void ResourceEditorPlugin::extensionsInitialized() FolderNode *const pn = file->parentFolderNode(); QTC_ASSERT(pn, continue); const Utils::FileName path = file->filePath(); - pn->replaceSubtree(file, std::make_unique<ResourceTopLevelNode>(path, file->isGenerated(), - QString(), pn)); + auto topLevel = std::make_unique<ResourceTopLevelNode>(path, QString(), pn); + topLevel->setIsGenerated(file->isGenerated()); + pn->replaceSubtree(file, std::move(topLevel)); } }); } diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index ee2099bbc0..5631d9b630 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -73,7 +73,7 @@ public: FolderNode *parent = m_node->parentFolderNode(); QTC_ASSERT(parent, return false); parent->replaceSubtree(m_node, std::make_unique<ResourceTopLevelNode>( - m_node->filePath(), false, m_node->contents(), parent)); + m_node->filePath(), m_node->contents(), parent)); return true; } @@ -264,11 +264,10 @@ bool SimpleResourceFolderNode::renameFile(const QString &filePath, const QString } // Internal -ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, bool generated, +ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, const QString &contents, FolderNode *parent) : FolderNode(filePath) { - setIsGenerated(generated); setIcon(FileIconProvider::icon(filePath.toString())); setPriority(Node::DefaultFilePriority); setListInProject(true); diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index 38175c322d..edfd4cb8d0 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -34,7 +34,7 @@ namespace Internal { class ResourceFileWatcher; } class RESOURCE_EXPORT ResourceTopLevelNode : public ProjectExplorer::FolderNode { public: - ResourceTopLevelNode(const Utils::FileName &filePath, bool generated, + ResourceTopLevelNode(const Utils::FileName &filePath, const QString &contents, FolderNode *parent); ~ResourceTopLevelNode() override; |