mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use unique desktop file name for static binary
This commit is contained in:
parent
78d874e9a3
commit
6805085bbc
1 changed files with 7 additions and 17 deletions
|
@ -273,8 +273,11 @@ bool GenerateDesktopFile(
|
||||||
target.write(fileText.toUtf8());
|
target.write(fileText.toUtf8());
|
||||||
target.close();
|
target.close();
|
||||||
|
|
||||||
DEBUG_LOG(("App Info: removing old .desktop file"));
|
if (IsStaticBinary()) {
|
||||||
QFile(qsl("%1telegram.desktop").arg(targetPath)).remove();
|
DEBUG_LOG(("App Info: removing old .desktop files"));
|
||||||
|
QFile(qsl("%1telegram.desktop").arg(targetPath)).remove();
|
||||||
|
QFile(qsl("%1telegramdesktop.desktop").arg(targetPath)).remove();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
@ -957,7 +960,7 @@ QString GetLauncherBasename() {
|
||||||
.arg(cExeName());
|
.arg(cExeName());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (InAppImage() && !cExeName().isEmpty()) {
|
if ((IsStaticBinary() || InAppImage()) && !cExeName().isEmpty()) {
|
||||||
const auto appimagePath = qsl("file://%1%2")
|
const auto appimagePath = qsl("file://%1%2")
|
||||||
.arg(cExeDir())
|
.arg(cExeDir())
|
||||||
.arg(cExeName())
|
.arg(cExeName())
|
||||||
|
@ -974,20 +977,7 @@ QString GetLauncherBasename() {
|
||||||
.arg(AppName.utf16().replace(' ', '_'));
|
.arg(AppName.utf16().replace(' ', '_'));
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto possibleBasenames = std::vector<QString>{
|
return qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME));
|
||||||
qsl(MACRO_TO_STRING(TDESKTOP_LAUNCHER_BASENAME)),
|
|
||||||
qsl("Telegram")
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const auto &it : possibleBasenames) {
|
|
||||||
if (!QStandardPaths::locate(
|
|
||||||
QStandardPaths::ApplicationsLocation,
|
|
||||||
it + qsl(".desktop")).isEmpty()) {
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return possibleBasenames[0];
|
|
||||||
}();
|
}();
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue