mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Move QGuiApplication::setDesktopFileName call to Platform::start
It depends on Core::UpdaterDisabled that is not initialized in Launcher::initHook yet
This commit is contained in:
parent
00ee31ce2d
commit
88f1f8ff22
2 changed files with 20 additions and 19 deletions
|
@ -64,25 +64,6 @@ int Launcher::exec() {
|
||||||
|
|
||||||
void Launcher::initHook() {
|
void Launcher::initHook() {
|
||||||
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
|
QApplication::setAttribute(Qt::AA_DisableSessionManager, true);
|
||||||
QApplication::setDesktopFileName([] {
|
|
||||||
if (!Core::UpdaterDisabled() && !cExeName().isEmpty()) {
|
|
||||||
const auto appimagePath = qsl("file://%1%2").arg(
|
|
||||||
cExeDir(),
|
|
||||||
cExeName()).toUtf8();
|
|
||||||
|
|
||||||
char md5Hash[33] = { 0 };
|
|
||||||
hashMd5Hex(
|
|
||||||
appimagePath.constData(),
|
|
||||||
appimagePath.size(),
|
|
||||||
md5Hash);
|
|
||||||
|
|
||||||
return qsl("appimagekit_%1-%2.desktop").arg(
|
|
||||||
md5Hash,
|
|
||||||
AppName.utf16().replace(' ', '_'));
|
|
||||||
}
|
|
||||||
|
|
||||||
return qsl(QT_STRINGIFY(TDESKTOP_LAUNCHER_BASENAME) ".desktop");
|
|
||||||
}());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Launcher::launchUpdater(UpdaterLaunch action) {
|
bool Launcher::launchUpdater(UpdaterLaunch action) {
|
||||||
|
|
|
@ -488,6 +488,26 @@ int psFixPrevious() {
|
||||||
namespace Platform {
|
namespace Platform {
|
||||||
|
|
||||||
void start() {
|
void start() {
|
||||||
|
QGuiApplication::setDesktopFileName([] {
|
||||||
|
if (!Core::UpdaterDisabled() && !cExeName().isEmpty()) {
|
||||||
|
const auto appimagePath = qsl("file://%1%2").arg(
|
||||||
|
cExeDir(),
|
||||||
|
cExeName()).toUtf8();
|
||||||
|
|
||||||
|
char md5Hash[33] = { 0 };
|
||||||
|
hashMd5Hex(
|
||||||
|
appimagePath.constData(),
|
||||||
|
appimagePath.size(),
|
||||||
|
md5Hash);
|
||||||
|
|
||||||
|
return qsl("appimagekit_%1-%2.desktop").arg(
|
||||||
|
md5Hash,
|
||||||
|
AppName.utf16().replace(' ', '_'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return qsl(QT_STRINGIFY(TDESKTOP_LAUNCHER_BASENAME) ".desktop");
|
||||||
|
}());
|
||||||
|
|
||||||
LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));
|
LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));
|
||||||
|
|
||||||
qputenv("PULSE_PROP_application.name", AppName.utf8());
|
qputenv("PULSE_PROP_application.name", AppName.utf8());
|
||||||
|
|
Loading…
Add table
Reference in a new issue