From 25096de511693734eebdb1a98c8458fe90884d8b Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Fri, 27 Feb 2015 09:36:54 +0200 Subject: [PATCH] ProjectExplorer: Avoid copy for node path It appears to take 7% of project loading... Change-Id: I2d20d919cc861a6ee95af359a584fb27a915cf80 Reviewed-by: Daniel Teske --- src/plugins/projectexplorer/projectnodes.cpp | 2 +- src/plugins/projectexplorer/projectnodes.h | 2 +- src/plugins/resourceeditor/resourcenode.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/projectexplorer/projectnodes.cpp b/src/plugins/projectexplorer/projectnodes.cpp index 860a3478442..800ccfc9425 100644 --- a/src/plugins/projectexplorer/projectnodes.cpp +++ b/src/plugins/projectexplorer/projectnodes.cpp @@ -155,7 +155,7 @@ FolderNode *Node::parentFolderNode() const /*! The path of the file or folder in the filesystem the node represents. */ -Utils::FileName Node::path() const +const Utils::FileName &Node::path() const { return m_path; } diff --git a/src/plugins/projectexplorer/projectnodes.h b/src/plugins/projectexplorer/projectnodes.h index 64037a1cdc8..8e9f6533479 100644 --- a/src/plugins/projectexplorer/projectnodes.h +++ b/src/plugins/projectexplorer/projectnodes.h @@ -112,7 +112,7 @@ public: NodeType nodeType() const; ProjectNode *projectNode() const; // managing project FolderNode *parentFolderNode() const; // parent folder or project - Utils::FileName path() const; // file system path + const Utils::FileName &path() const; // file system path int line() const; virtual QString displayName() const; virtual QString tooltip() const; diff --git a/src/plugins/resourceeditor/resourcenode.cpp b/src/plugins/resourceeditor/resourcenode.cpp index d2dcb5fd239..541b8f5dc44 100644 --- a/src/plugins/resourceeditor/resourcenode.cpp +++ b/src/plugins/resourceeditor/resourcenode.cpp @@ -286,7 +286,7 @@ bool ResourceTopLevelNode::showInSimpleTree() const } ResourceFolderNode::ResourceFolderNode(const QString &prefix, const QString &lang, ResourceTopLevelNode *parent) - : ProjectExplorer::FolderNode(parent->path().appendPath(prefix)), + : ProjectExplorer::FolderNode(Utils::FileName(parent->path()).appendPath(prefix)), // TOOD Why add existing directory doesn't work m_topLevelNode(parent), m_prefix(prefix),