Commit 08f02266 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

Don't fetch pixmap if we have it already

AppData contains a QIcon with pixmap data gathered from KWindowSystem::icon which we can just use.
Only if, for some reason, the icon is really null, try getting it from KWindowSystem on demand.

Differential Revision: https://phabricator.kde.org/D26086
parent 730edd07
......@@ -554,7 +554,16 @@ QUrl XWindowTasksModel::Private::launcherUrl(WId window, bool encodeFallbackIcon
return url;
}
const QPixmap pixmap = KWindowSystem::icon(window, KIconLoader::SizeLarge, KIconLoader::SizeLarge, false);
QPixmap pixmap;
if (!data.icon.isNull()) {
pixmap = data.icon.pixmap(KIconLoader::SizeLarge);
}
if (pixmap.isNull()) {
pixmap = KWindowSystem::icon(window, KIconLoader::SizeLarge, KIconLoader::SizeLarge, false);
}
if (pixmap.isNull()) {
return data.url;
}
......
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