[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.
icc-effect-5.14.5
Martin Gräßlin 2015-07-15 17:18:39 +02:00
parent f7d317601e
commit a3db04f66e
1 changed files with 6 additions and 2 deletions

View File

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