From a3db04f66eae75474512ce61d4dd768ea9a5cf58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Wed, 15 Jul 2015 17:18:39 +0200 Subject: [PATCH] [wayland] Improve mapping of windowClass to desktop file QtWayland might also pass a name like "app.desktop". In that case we should not append .desktop to it. --- shell_client.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/shell_client.cpp b/shell_client.cpp index 90ec8dc5f7..b02fad7902 100644 --- a/shell_client.cpp +++ b/shell_client.cpp @@ -672,10 +672,14 @@ bool ShellClient::hasStrut() const void ShellClient::updateIcon() { - if (m_shellSurface->windowClass().isEmpty()) { + QString desktopFile = QString::fromUtf8(m_shellSurface->windowClass()); + if (desktopFile.isEmpty()) { setIcon(QIcon()); } - KDesktopFile df(QStringLiteral("%0.desktop").arg(QString::fromUtf8(m_shellSurface->windowClass()))); + if (!desktopFile.endsWith(QLatin1String(".desktop"))) { + desktopFile.append(QLatin1String(".desktop")); + } + KDesktopFile df(desktopFile); setIcon(QIcon::fromTheme(df.readIcon())); }