From 4a0ee226705beada1322723c8065824791db4707 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Mon, 27 Nov 2023 03:45:59 +0400 Subject: [PATCH] Shorten setting QSessionManager restart hint --- Telegram/SourceFiles/core/sandbox.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Telegram/SourceFiles/core/sandbox.cpp b/Telegram/SourceFiles/core/sandbox.cpp index 169745533..fc4d61983 100644 --- a/Telegram/SourceFiles/core/sandbox.cpp +++ b/Telegram/SourceFiles/core/sandbox.cpp @@ -181,16 +181,9 @@ int Sandbox::start() { // https://github.com/telegramdesktop/tdesktop/issues/948 // and https://github.com/telegramdesktop/tdesktop/issues/5022 - const auto restartHint = [](QSessionManager &manager) { + connect(this, &QGuiApplication::saveStateRequest, [](auto &manager) { manager.setRestartHint(QSessionManager::RestartNever); - }; - - connect( - this, - &QGuiApplication::saveStateRequest, - this, - restartHint, - Qt::DirectConnection); + }); LOG(("Connecting local socket to %1...").arg(_localServerName)); _localSocket.connectToServer(_localServerName);