From 1e9b7e2726add6b87bd54d8532783b30cc22c553 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 7 Mar 2024 01:24:50 +0400 Subject: [PATCH] Use XDP::kObjectPath for session and request paths --- Telegram/SourceFiles/platform/linux/integration_linux.cpp | 3 ++- .../SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp | 4 ++-- Telegram/SourceFiles/platform/linux/specific_linux.cpp | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/integration_linux.cpp b/Telegram/SourceFiles/platform/linux/integration_linux.cpp index 6613f7382..fef646b20 100644 --- a/Telegram/SourceFiles/platform/linux/integration_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/integration_linux.cpp @@ -252,7 +252,8 @@ void LinuxIntegration::initInhibit() { const auto sessionHandleToken = "tdesktop" + std::to_string(base::RandomValue()); - const auto sessionHandle = "/org/freedesktop/portal/desktop/session/" + const auto sessionHandle = base::Platform::XDP::kObjectPath + + std::string("/session/") + uniqueName + '/' + sessionHandleToken; diff --git a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp index e75bcb421..b01d5abbe 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp @@ -66,8 +66,8 @@ bool ShowXDPOpenWithDialog(const QString &filepath) { uniqueName.erase(0, 1); uniqueName.replace(uniqueName.find('.'), 1, 1, '_'); - const auto requestPath = Glib::ustring( - "/org/freedesktop/portal/desktop/request/") + const auto requestPath = base::Platform::XDP::kObjectPath + + Glib::ustring("/request/") + uniqueName + '/' + handleToken; diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index a63c54bc7..c0cbed82e 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -105,8 +105,8 @@ void PortalAutostart(bool enabled, Fn done) { uniqueName.erase(0, 1); uniqueName.replace(uniqueName.find('.'), 1, 1, '_'); - const auto requestPath = Glib::ustring( - "/org/freedesktop/portal/desktop/request/") + const auto requestPath = base::Platform::XDP::kObjectPath + + Glib::ustring("/request/") + uniqueName + '/' + handleToken;