ResourceEditor: Use Node::setIsGenerated setter

Change-Id: I51029f4d92b6959da363dc9f4f5efddf63c57894
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-02-26 08:24:16 +01:00
parent 5cc1aee7ff
commit 0b593951d0
4 changed files with 7 additions and 7 deletions

View File

@@ -168,7 +168,7 @@ static void createTree(const QmakePriFile *pri, QmakePriFileNode *node, const Fi
int eid = vfs->idForFileName(file.toString(), QMakeVfs::VfsExact);
vfs->readFile(eid, &contents, &errorMessage);
}
vfolder->addNode(std::make_unique<ResourceEditor::ResourceTopLevelNode>(file, false, contents, vfolder.get()));
vfolder->addNode(std::make_unique<ResourceEditor::ResourceTopLevelNode>(file, contents, vfolder.get()));
}
} else {
for (const FileName &fn : newFilePaths) {

View File

@@ -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));
}
});
}

View File

@@ -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);

View File

@@ -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;