Remove outdated snap autostart hack
This commit is contained in:
parent
786bedf271
commit
170ec16f39
|
@ -68,7 +68,6 @@ constexpr auto kDisableGtkIntegration = "TDESKTOP_DISABLE_GTK_INTEGRATION"_cs;
|
||||||
constexpr auto kIgnoreGtkIncompatibility = "TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY"_cs;
|
constexpr auto kIgnoreGtkIncompatibility = "TDESKTOP_I_KNOW_ABOUT_GTK_INCOMPATIBILITY"_cs;
|
||||||
|
|
||||||
constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs;
|
constexpr auto kDesktopFile = ":/misc/telegramdesktop.desktop"_cs;
|
||||||
constexpr auto kSnapLauncherDir = "/var/lib/snapd/desktop/applications/"_cs;
|
|
||||||
constexpr auto kIconName = "telegram"_cs;
|
constexpr auto kIconName = "telegram"_cs;
|
||||||
|
|
||||||
constexpr auto kXDGDesktopPortalService = "org.freedesktop.portal.Desktop"_cs;
|
constexpr auto kXDGDesktopPortalService = "org.freedesktop.portal.Desktop"_cs;
|
||||||
|
@ -264,14 +263,7 @@ bool GenerateDesktopFile(
|
||||||
DEBUG_LOG(("App Info: placing .desktop file to %1").arg(targetPath));
|
DEBUG_LOG(("App Info: placing .desktop file to %1").arg(targetPath));
|
||||||
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);
|
if (!QDir(targetPath).exists()) QDir().mkpath(targetPath);
|
||||||
|
|
||||||
const auto sourceFile = [&] {
|
const auto sourceFile = kDesktopFile.utf16();
|
||||||
if (InSnap()) {
|
|
||||||
return kSnapLauncherDir.utf16() + GetLauncherFilename();
|
|
||||||
} else {
|
|
||||||
return kDesktopFile.utf16();
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
const auto targetFile = targetPath + GetLauncherFilename();
|
const auto targetFile = targetPath + GetLauncherFilename();
|
||||||
|
|
||||||
QString fileText;
|
QString fileText;
|
||||||
|
@ -1380,19 +1372,9 @@ void psAutoStart(bool start, bool silent) {
|
||||||
PortalAutostart(start, silent);
|
PortalAutostart(start, silent);
|
||||||
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
|
||||||
} else {
|
} else {
|
||||||
const auto autostart = [&] {
|
const auto autostart = QStandardPaths::writableLocation(
|
||||||
if (InSnap()) {
|
QStandardPaths::GenericConfigLocation)
|
||||||
QDir realHomeDir(home);
|
+ qsl("/autostart/");
|
||||||
realHomeDir.cd(qsl("../../.."));
|
|
||||||
|
|
||||||
return realHomeDir
|
|
||||||
.absoluteFilePath(qsl(".config/autostart/"));
|
|
||||||
} else {
|
|
||||||
return QStandardPaths::writableLocation(
|
|
||||||
QStandardPaths::GenericConfigLocation)
|
|
||||||
+ qsl("/autostart/");
|
|
||||||
}
|
|
||||||
}();
|
|
||||||
|
|
||||||
if (start) {
|
if (start) {
|
||||||
GenerateDesktopFile(autostart, qsl("-autostart"), silent);
|
GenerateDesktopFile(autostart, qsl("-autostart"), silent);
|
||||||
|
|
Loading…
Reference in New Issue