diff options
author | Maciej <sppmacd@pm.me> | 2021-12-29 17:23:43 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-21 13:44:36 +0100 |
commit | 07cf2218cb39decb7fa5eff0462fe22af43c79e9 (patch) | |
tree | 05045b62ede60aef971e4f5af53931b9a50a5a43 /Userland | |
parent | 3022baddc23d80fc90abcd32ac14b51b5f718889 (diff) | |
download | serenity-07cf2218cb39decb7fa5eff0462fe22af43c79e9.zip |
LibDesktop: Add Launcher::ensure_connection()
This can be use force connection at startup and not to leave 'unix'
pledge all the time.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibDesktop/Launcher.cpp | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibDesktop/Launcher.h | 1 |
2 files changed, 6 insertions, 0 deletions
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<void> 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<Details> from_details_str(const String&); }; + static void ensure_connection(); static ErrorOr<void> add_allowed_url(URL const&); static ErrorOr<void> add_allowed_handler_with_any_url(String const& handler); static ErrorOr<void> add_allowed_handler_with_only_specific_urls(String const& handler, Vector<URL> const&); |