Commit 60bf6410 authored by Friedemann Kleint's avatar Friedemann Kleint
Browse files

Projectexplorer: Delay querying for folder icon.



As a custom icon is set in most cases anyway.
Reviewed-by: default avatarRobert Loehning <robert.loehning@nokia.com>
parent b546e979
......@@ -154,8 +154,7 @@ bool FileNode::isGenerated() const
*/
FolderNode::FolderNode(const QString &folderPath) :
Node(FolderNodeType, folderPath),
m_displayName(QDir::toNativeSeparators(folderPath)),
m_icon(Core::FileIconProvider::instance()->icon(QFileIconProvider::Folder))
m_displayName(QDir::toNativeSeparators(folderPath))
{
}
......@@ -182,6 +181,9 @@ QString FolderNode::displayName() const
*/
QIcon FolderNode::icon() const
{
// Instantiating the Icon provider is expensive.
if (m_icon.isNull())
m_icon = Core::FileIconProvider::instance()->icon(QFileIconProvider::Folder);
return m_icon;
}
......
......@@ -147,7 +147,7 @@ private:
// managed by ProjectNode
friend class ProjectNode;
QString m_displayName;
QIcon m_icon;
mutable QIcon m_icon;
};
class PROJECTEXPLORER_EXPORT ProjectNode : public FolderNode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment