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

@@ -265,7 +265,7 @@ ClangdTextMark::ClangdTextMark(TextEditor::TextDocument *doc,
// Copy to clipboard action
QList<QAction *> actions;
QAction *action = new QAction();
action->setIcon(QIcon::fromTheme("edit-copy", Icons::COPY.icon()));
action->setIcon(Icon::fromTheme("edit-copy"));
action->setToolTip(Tr::tr("Copy to Clipboard", "Clang Code Model Marks"));
QObject::connect(action, &QAction::triggered, [diag] {
const QString text = ClangDiagnosticWidget::createText({diag},