From d80b3fda7d635f78f91ed834ca585fd494debb63 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 30 Jan 2020 21:03:20 +0400 Subject: [PATCH] Fix duplicate object path in SandboxAutostart and add some logging --- .../platform/linux/notifications_manager_linux.cpp | 2 +- .../SourceFiles/platform/linux/specific_linux.cpp | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp index 46ad6f85b5..c399f97b28 100644 --- a/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/notifications_manager_linux.cpp @@ -47,7 +47,7 @@ std::vector GetServerInformation( } } else if (serverInformationReply.type() == QDBusMessage::ErrorMessage) { LOG(("Native notification error: %1") - .arg(QDBusError(serverInformationReply).message())); + .arg(serverInformationReply.errorMessage())); } else { LOG(("Native notification error: " "error while getting information about notification daemon")); diff --git a/Telegram/SourceFiles/platform/linux/specific_linux.cpp b/Telegram/SourceFiles/platform/linux/specific_linux.cpp index 741d69274c..51fc1e9024 100644 --- a/Telegram/SourceFiles/platform/linux/specific_linux.cpp +++ b/Telegram/SourceFiles/platform/linux/specific_linux.cpp @@ -55,11 +55,18 @@ void SandboxAutostart(bool autostart) { }); options["dbus-activatable"] = false; - QDBusInterface( + const auto requestBackgroundReply = QDBusInterface( qsl("org.freedesktop.portal.Desktop"), qsl("/org/freedesktop/portal/desktop"), - qsl("/org/freedesktop/portal/desktop") + qsl("org.freedesktop.portal.Background") ).call(qsl("RequestBackground"), QString(), options); + + if (requestBackgroundReply.type() == QDBusMessage::ErrorMessage) { + LOG(("Flatpak autostart error: %1") + .arg(requestBackgroundReply.errorMessage())); + } else if (requestBackgroundReply.type() != QDBusMessage::ReplyMessage) { + LOG(("Flatpak autostart error: invalid reply")); + } } #endif