[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.
This commit is contained in:
parent
f7d317601e
commit
a3db04f66e
1 changed files with 6 additions and 2 deletions
|
@ -672,10 +672,14 @@ bool ShellClient::hasStrut() const
|
||||||
|
|
||||||
void ShellClient::updateIcon()
|
void ShellClient::updateIcon()
|
||||||
{
|
{
|
||||||
if (m_shellSurface->windowClass().isEmpty()) {
|
QString desktopFile = QString::fromUtf8(m_shellSurface->windowClass());
|
||||||
|
if (desktopFile.isEmpty()) {
|
||||||
setIcon(QIcon());
|
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()));
|
setIcon(QIcon::fromTheme(df.readIcon()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue