Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 94ed49ac authored by Milian Wolff's avatar Milian Wolff

Performance: Reuse the global icon loader

I just found a noticeable GUI hang when showing a problem widget
for a missing include path. There, the profiler pointed me at
KIconLoader which was reconstructed whenever we query for the icon
representing the severity of a problem.

By reusing the global icon loader, we can get the information from
the cache which is significantly faster.

Reviewers: #kdevelop

Subscribers: kdevelop-devel

Differential Revision:
parent f2a6941e
......@@ -55,11 +55,11 @@ QString iconForSeverity(IProblem::Severity severity)
QString htmlImg(const QString& iconName, KIconLoader::Group group)
KIconLoader loader;
const int size = loader.currentSize(group);
auto* loader = KIconLoader::global();
const int size = loader->currentSize(group);
return QStringLiteral("<img width='%1' height='%1' src='%2'/>")
.arg(loader.iconPath(iconName, group));
.arg(loader->iconPath(iconName, group));
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