From 07cf2218cb39decb7fa5eff0462fe22af43c79e9 Mon Sep 17 00:00:00 2001 From: Maciej Date: Wed, 29 Dec 2021 17:23:43 +0100 Subject: [PATCH] LibDesktop: Add Launcher::ensure_connection() This can be use force connection at startup and not to leave 'unix' pledge all the time. --- Userland/Libraries/LibDesktop/Launcher.cpp | 5 +++++ Userland/Libraries/LibDesktop/Launcher.h | 1 + 2 files changed, 6 insertions(+) diff --git a/Userland/Libraries/LibDesktop/Launcher.cpp b/Userland/Libraries/LibDesktop/Launcher.cpp index 8c91d6adc8..fed12f699e 100644 --- a/Userland/Libraries/LibDesktop/Launcher.cpp +++ b/Userland/Libraries/LibDesktop/Launcher.cpp @@ -50,6 +50,11 @@ static LaunchServerConnection& connection() return connection; } +void Launcher::ensure_connection() +{ + [[maybe_unused]] auto& conn = connection(); +} + ErrorOr Launcher::add_allowed_url(URL const& url) { auto response_or_error = connection().try_add_allowed_url(url); diff --git a/Userland/Libraries/LibDesktop/Launcher.h b/Userland/Libraries/LibDesktop/Launcher.h index a74a6505a6..c62764a011 100644 --- a/Userland/Libraries/LibDesktop/Launcher.h +++ b/Userland/Libraries/LibDesktop/Launcher.h @@ -31,6 +31,7 @@ public: static NonnullRefPtr
from_details_str(const String&); }; + static void ensure_connection(); static ErrorOr add_allowed_url(URL const&); static ErrorOr add_allowed_handler_with_any_url(String const& handler); static ErrorOr add_allowed_handler_with_only_specific_urls(String const& handler, Vector const&);