diff --git a/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp b/src/plugins/qmakeprojectmanager/qmakenodetreebuilder.cpp index a302b4db08d..adba361c154 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, const Fi int eid = vfs->idForFileName(file.toString(), QMakeVfs::VfsExact); vfs->readFile(eid, &contents, &errorMessage); } - vfolder->addNode(std::make_unique(file, contents, vfolder.get())); + vfolder->addNode(std::make_unique + (file, vfolder->filePath(), contents)); } } else { for (const FileName &fn : newFilePaths) { diff --git a/src/plugins/resourceeditor/resourceeditorplugin.cpp b/src/plugins/resourceeditor/resourceeditorplugin.cpp index c7de69cb630..f5c3fa19289 100644 --- a/src/plugins/resourceeditor/resourceeditorplugin.cpp +++ b/src/plugins/resourceeditor/resourceeditorplugin.cpp @@ -217,7 +217,7 @@ void ResourceEditorPlugin::extensionsInitialized() FolderNode *const pn = file->parentFolderNode(); QTC_ASSERT(pn, continue); const Utils::FileName path = file->filePath(); - auto topLevel = std::make_unique(path, QString(), pn); + auto topLevel = std::make_unique(path, pn->filePath()); 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 8431fa16fe2..cc9888ca6ac 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( - m_node->filePath(), m_node->contents(), parent)); + m_node->filePath(), parent->filePath(), m_node->contents())); return true; } @@ -265,7 +265,8 @@ bool SimpleResourceFolderNode::renameFile(const QString &filePath, const QString } // Internal ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, - const QString &contents, FolderNode *parent) + const FileName &base, + const QString &contents) : FolderNode(filePath) { setIcon(FileIconProvider::icon(filePath.toString())); @@ -283,7 +284,6 @@ ResourceTopLevelNode::ResourceTopLevelNode(const FileName &filePath, m_contents = contents; } - FileName base = parent->filePath(); if (filePath.isChildOf(base)) setDisplayName(filePath.relativeChildPath(base).toUserOutput()); else diff --git a/src/plugins/resourceeditor/resourcenode.h b/src/plugins/resourceeditor/resourcenode.h index 9d38e3c6222..f732c6ae522 100644 --- a/src/plugins/resourceeditor/resourcenode.h +++ b/src/plugins/resourceeditor/resourcenode.h @@ -35,7 +35,8 @@ class RESOURCE_EXPORT ResourceTopLevelNode : public ProjectExplorer::FolderNode { public: ResourceTopLevelNode(const Utils::FileName &filePath, - const QString &contents, FolderNode *parent); + const Utils::FileName &basePath, + const QString &contents = {}); ~ResourceTopLevelNode() override; void addInternalNodes();