Utils: Cache theme icon access

These trigger over 120k file exist check on my machine on startup,
just for a handful icons.

Change-Id: Ic73f0783142ed329c2f8c8b852f622e69fc306da
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2023-09-01 12:28:51 +02:00
parent c2a69683cf
commit 67212a31ee
17 changed files with 92 additions and 45 deletions

View File

@@ -15,7 +15,7 @@
#include <utils/mimeutils.h>
#include <utils/process.h>
#include <utils/qtcassert.h>
#include <utils/utilsicons.h>
#include <utils/icon.h>
#include <projectexplorer/projecttree.h>
@@ -516,8 +516,7 @@ FolderNode *createSourceGroupNode(const QString &sourceGroupName,
if (!existingNode) {
auto node = createCMakeVFolder(sourceDirectory, Node::DefaultFolderPriority + 5, p);
node->setListInProject(false);
node->setIcon(
[] { return QIcon::fromTheme("edit-copy", ::Utils::Icons::COPY.icon()); });
node->setIcon([] { return Icon::fromTheme("edit-copy"); });
existingNode = node.get();