Skip to content

Commit

Permalink
Always pass activation_token option
Browse files Browse the repository at this point in the history
glib shows a warning about invalid GVariant and empty activation_token shouldn't hurt I believe
  • Loading branch information
ilya-fedin authored and john-preston committed Aug 3, 2022
1 parent 500731e commit 283ae7e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions base/platform/linux/base_file_utilities_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ bool PortalShowInFolder(const QString &filepath) {

const auto guard = gsl::finally([&] { close(fd); });

const auto activationToken = []() -> std::optional<Glib::ustring> {
const auto activationToken = []() -> Glib::ustring {
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 {};
}();

const auto fdList = Gio::UnixFDList::create();
Expand All @@ -75,12 +75,10 @@ bool PortalShowInFolder(const QString &filepath) {
Glib::ustring,
Glib::VariantBase
>>::create({
activationToken
? std::pair<Glib::ustring, Glib::VariantBase>{
"activation_token",
Glib::Variant<Glib::ustring>::create(*activationToken)
}
: std::pair<Glib::ustring, Glib::VariantBase>{},
{
"activation_token",
Glib::Variant<Glib::ustring>::create(activationToken)
},
}),
}),
fdList,
Expand Down

0 comments on commit 283ae7e

Please sign in to comment.