mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-31 14:38:15 +00:00
Revert "Move icon name getter to cross-platform header"
This reverts commit d9318c9935
.
This commit is contained in:
@@ -11,6 +11,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "base/options.h"
|
||||
#include "base/platform/base_platform_info.h"
|
||||
#include "base/platform/linux/base_linux_dbus_utilities.h"
|
||||
#include "platform/platform_specific.h"
|
||||
#include "core/application.h"
|
||||
#include "core/sandbox.h"
|
||||
#include "core/core_settings.h"
|
||||
@@ -27,6 +28,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include <QtCore/QVersionNumber>
|
||||
#include <QtGui/QGuiApplication>
|
||||
|
||||
#include <ksandbox.h>
|
||||
|
||||
#include <xdgnotifications/xdgnotifications.hpp>
|
||||
|
||||
#include <dlfcn.h>
|
||||
@@ -547,7 +550,7 @@ void Manager::Private::showNotification(
|
||||
notification.set_body(info.message.toStdString());
|
||||
|
||||
notification.set_icon(
|
||||
Gio::ThemedIcon::new_(base::IconName().toStdString()));
|
||||
Gio::ThemedIcon::new_(ApplicationIconName().toStdString()));
|
||||
|
||||
// for chat messages, according to
|
||||
// https://docs.gtk.org/gio/enum.NotificationPriority.html
|
||||
@@ -761,7 +764,7 @@ void Manager::Private::showNotification(
|
||||
AppName.data(),
|
||||
0,
|
||||
(!hasImage
|
||||
? base::IconName().toStdString()
|
||||
? ApplicationIconName().toStdString()
|
||||
: std::string()).c_str(),
|
||||
(hasBodyMarkup || info.subtitle.isEmpty()
|
||||
? info.title.toStdString()
|
||||
|
@@ -486,7 +486,7 @@ void InstallLauncher() {
|
||||
|
||||
if (!QDir(icons).exists()) QDir().mkpath(icons);
|
||||
|
||||
const auto icon = icons + base::IconName() + u".png"_q;
|
||||
const auto icon = icons + ApplicationIconName() + u".png"_q;
|
||||
QFile::remove(icon);
|
||||
if (QFile::copy(u":/gui/art/logo_256.png"_q, icon)) {
|
||||
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
|
||||
@@ -684,7 +684,9 @@ void start() {
|
||||
}
|
||||
|
||||
qputenv("PULSE_PROP_application.name", AppName.utf8());
|
||||
qputenv("PULSE_PROP_application.icon_name", base::IconName().toLatin1());
|
||||
qputenv(
|
||||
"PULSE_PROP_application.icon_name",
|
||||
ApplicationIconName().toUtf8());
|
||||
|
||||
GLib::set_prgname(cExeName().toStdString());
|
||||
GLib::set_application_name(AppName.data());
|
||||
@@ -755,6 +757,13 @@ QImage DefaultApplicationIcon() {
|
||||
return Window::Logo();
|
||||
}
|
||||
|
||||
QString ApplicationIconName() {
|
||||
static const auto Result = KSandbox::isFlatpak()
|
||||
? qEnvironmentVariable("FLATPAK_ID")
|
||||
: u"telegram"_q;
|
||||
return Result;
|
||||
}
|
||||
|
||||
namespace ThirdParty {
|
||||
|
||||
void start() {
|
||||
|
@@ -88,7 +88,7 @@ QIcon IconGraphic::systemIcon() const {
|
||||
|
||||
const auto candidates = {
|
||||
_new.monochrome ? PanelIconName(_new.counter, _new.muted) : QString(),
|
||||
base::IconName(),
|
||||
ApplicationIconName(),
|
||||
};
|
||||
|
||||
for (const auto &candidate : candidates) {
|
||||
|
Reference in New Issue
Block a user