Always use app ID based icon name

This allows to unify it between flatpak and non-flatpak builds and corresponds to what most other GUI apps on Linux do
This commit is contained in:
Ilya Fedin
2025-03-11 05:51:46 +00:00
committed by John Preston
parent b14c2878b3
commit 228bbc1e8e
5 changed files with 16 additions and 18 deletions
@@ -488,6 +488,7 @@ void InstallLauncher() {
const auto icon = icons + ApplicationIconName() + u".png"_q;
QFile::remove(icon);
QFile::remove(icons + u"telegram.png"_q);
if (QFile::copy(u":/gui/art/logo_256.png"_q, icon)) {
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
}
@@ -758,9 +759,8 @@ QImage DefaultApplicationIcon() {
}
QString ApplicationIconName() {
static const auto Result = KSandbox::isFlatpak()
? qEnvironmentVariable("FLATPAK_ID")
: u"telegram"_q;
static const auto Result = QGuiApplication::desktopFileName().remove(
u"._"_q + Core::Launcher::Instance().instanceHash());
return Result;
}