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
wilder-5.18
Kai Uwe Broulik 6 years ago
parent 730edd07b8
commit 08f02266c9
  1. 11
      libtaskmanager/xwindowtasksmodel.cpp

@ -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;
}

Loading…
Cancel
Save