From bf339de7737e9e0a163c6daaa93fe8588b226d3b Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Wed, 3 Aug 2022 22:37:02 +0400 Subject: [PATCH] Always pass activation_token option glib shows a warning about invalid GVariant and empty activation_token shouldn't hurt I believe --- .../linux/linux_xdp_open_with_dialog.cpp | 16 +++++++--------- Telegram/lib_base | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) 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 e57c5744a..876e57207 100644 --- a/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp +++ b/Telegram/SourceFiles/platform/linux/linux_xdp_open_with_dialog.cpp @@ -78,15 +78,15 @@ bool ShowXDPOpenWithDialog(const QString &filepath) { const auto handleToken = Glib::ustring("tdesktop") + std::to_string(base::RandomValue()); - const auto activationToken = []() -> std::optional { + const auto activationToken = []() -> Glib::ustring { using base::Platform::WaylandIntegration; if (const auto integration = WaylandIntegration::Instance()) { if (const auto token = integration->activationToken() ; !token.isNull()) { - return Glib::ustring(token.toStdString()); + return token.toStdString(); } } - return std::nullopt; + return {}; }(); auto uniqueName = connection->get_unique_name(); @@ -141,16 +141,14 @@ bool ShowXDPOpenWithDialog(const QString &filepath) { "handle_token", Glib::Variant::create(handleToken) }, + { + "activation_token", + Glib::Variant::create(activationToken) + }, { "ask", Glib::Variant::create(true) }, - activationToken - ? std::pair{ - "activation_token", - Glib::Variant::create(*activationToken) - } - : std::pair{}, }), }), fdList, diff --git a/Telegram/lib_base b/Telegram/lib_base index 500731e1f..283ae7e06 160000 --- a/Telegram/lib_base +++ b/Telegram/lib_base @@ -1 +1 @@ -Subproject commit 500731e1f9a4a8b98e388e7a06b91b41d8df7211 +Subproject commit 283ae7e06112b3fa81da9e87b7fce037c8fb2ccf