From b2aacba0862a6ae7ae301b1bf9e0176790043bcb Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Mon, 18 Jul 2022 19:35:21 +0200 Subject: [PATCH] activation: Simplify icon loading logic --- src/xdgactivationv1.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xdgactivationv1.cpp b/src/xdgactivationv1.cpp index 04e2750643..e15fa201ce 100644 --- a/src/xdgactivationv1.cpp +++ b/src/xdgactivationv1.cpp @@ -74,7 +74,7 @@ QString XdgActivationV1Integration::requestToken(bool isPrivileged, SurfaceInter clear(); } bool showNotify = false; - QIcon icon; + QIcon icon = QIcon::fromTheme(QStringLiteral("system-run")); if (const QString desktopFilePath = Window::findDesktopFile(appId); !desktopFilePath.isEmpty()) { KDesktopFile df(desktopFilePath); Window *window = Workspace::self()->activeWindow(); @@ -82,11 +82,10 @@ QString XdgActivationV1Integration::requestToken(bool isPrivileged, SurfaceInter const auto desktop = df.desktopGroup(); showNotify = desktop.readEntry("X-KDE-StartupNotify", desktop.readEntry("StartupNotify", true)); } - icon = QIcon::fromTheme(df.readIcon(), QIcon::fromTheme(QStringLiteral("system-run"))); + icon = QIcon::fromTheme(df.readIcon(), icon); } m_currentActivationToken.reset(new ActivationToken{newToken, isPrivileged, surface, serial, seat, appId, showNotify, waylandServer()->plasmaActivationFeedback()->createActivation(appId)}); if (showNotify) { - const auto icon = QIcon::fromTheme(Window::iconFromDesktopFile(appId), QIcon::fromTheme(QStringLiteral("system-run"))); Q_EMIT effects->startupAdded(m_currentActivationToken->token, icon); } return newToken;