From 07d950bded2b8e50eb330fab1b2320539f16277d Mon Sep 17 00:00:00 2001 From: David Faure Date: Mon, 13 Jun 2016 12:36:02 +0200 Subject: [PATCH] Tasks model: don't load 4 icon sizes to then just use one. Reviewers: hein Reviewed By: hein Subscribers: broulik, plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D1841 --- libtaskmanager/xwindowtasksmodel.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libtaskmanager/xwindowtasksmodel.cpp b/libtaskmanager/xwindowtasksmodel.cpp index 5c80470dc..d5b44f8d2 100644 --- a/libtaskmanager/xwindowtasksmodel.cpp +++ b/libtaskmanager/xwindowtasksmodel.cpp @@ -657,17 +657,15 @@ QUrl XWindowTasksModel::Private::launcherUrl(WId window) return data.url; } - const QIcon &i = icon(window); + QUrl url = data.url; + + // FIXME Hard-coding 64x64 or SizeLarge is not scaling-aware. - if (i.isNull()) { + const QPixmap pixmap = KWindowSystem::icon(window, KIconLoader::SizeLarge, KIconLoader::SizeLarge, false); + if (pixmap.isNull()) { return data.url; } - - QUrl url = data.url; QUrlQuery uQuery(url); - - // FIXME Hard-coding 64px is not scaling-aware. - const QPixmap pixmap = i.pixmap(QSize(64, 64)); QByteArray bytes; QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly);