aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/projectnodes.h
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2018-04-26 14:57:12 +0200
committerTobias Hunger <tobias.hunger@qt.io>2018-05-02 11:34:47 +0000
commit147e6078ad8c6a59a87789ad5bbfad196345286c (patch)
tree189cd8a597880556587f4b76a8e52c3f4b09fce0 /src/plugins/projectexplorer/projectnodes.h
parent04057106ba4f34eeeec86ef44dcf138eaccd55dd (diff)
ProjectExplorer: Make FolderNodeFactory return an unique_ptr
Change-Id: I9b611c4a3ff0928b2078dc30a44eb39df67c8d89 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/projectnodes.h')
-rw-r--r--src/plugins/projectexplorer/projectnodes.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h
index 036af4c84e..6f00ec20f5 100644
--- a/src/plugins/projectexplorer/projectnodes.h
+++ b/src/plugins/projectexplorer/projectnodes.h
@@ -221,11 +221,15 @@ public:
QList<FileNode *> fileNodes() const;
FileNode *fileNode(const Utils::FileName &file) const;
QList<FolderNode *> folderNodes() const;
- using FolderNodeFactory = std::function<FolderNode *(const Utils::FileName &)>;
+ using FolderNodeFactory = std::function<std::unique_ptr<FolderNode>(const Utils::FileName &)>;
void addNestedNodes(const QList<FileNode *> &files, const Utils::FileName &overrideBaseDir = Utils::FileName(),
- const FolderNodeFactory &factory = [](const Utils::FileName &fn) { return new FolderNode(fn); });
+ const FolderNodeFactory &factory = [](const Utils::FileName &fn) {
+ return std::make_unique<FolderNode>(fn);
+ });
void addNestedNode(FileNode *fileNode, const Utils::FileName &overrideBaseDir = Utils::FileName(),
- const FolderNodeFactory &factory = [](const Utils::FileName &fn) { return new FolderNode(fn); });
+ const FolderNodeFactory &factory = [](const Utils::FileName &fn) {
+ return std::make_unique<FolderNode>(fn);
+ });
void compress();
bool isAncesterOf(Node *n);