From f0d2489254490517d8a42367ae420254422d484e Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Wed, 9 Feb 2022 12:57:36 -0700 Subject: Applications: Port Assistant to LibMain --- Userland/Applications/Assistant/CMakeLists.txt | 2 +- Userland/Applications/Assistant/main.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'Userland/Applications') diff --git a/Userland/Applications/Assistant/CMakeLists.txt b/Userland/Applications/Assistant/CMakeLists.txt index 3f0e6c7cdd..1112ff5eeb 100644 --- a/Userland/Applications/Assistant/CMakeLists.txt +++ b/Userland/Applications/Assistant/CMakeLists.txt @@ -11,5 +11,5 @@ set(SOURCES ) serenity_app(Assistant ICON app-run) -target_link_libraries(Assistant LibCore LibDesktop LibGUI LibJS LibThreading) +target_link_libraries(Assistant LibCore LibDesktop LibGUI LibJS LibMain LibThreading) link_with_unicode_data(Assistant) diff --git a/Userland/Applications/Assistant/main.cpp b/Userland/Applications/Assistant/main.cpp index f58df60e4d..2d304830eb 100644 --- a/Userland/Applications/Assistant/main.cpp +++ b/Userland/Applications/Assistant/main.cpp @@ -1,13 +1,17 @@ /* * Copyright (c) 2021, Spencer Dixon + * Copyright (c) 2022, the SerenityOS developers. * * SPDX-License-Identifier: BSD-2-Clause */ #include "Providers.h" +#include #include #include +#include #include +#include #include #include #include @@ -17,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -186,12 +191,9 @@ private: static constexpr size_t MAX_SEARCH_RESULTS = 6; -int main(int argc, char** argv) +ErrorOr serenity_main(Main::Arguments arguments) { - if (pledge("stdio recvfd sendfd rpath cpath unix proc exec thread", nullptr) < 0) { - perror("pledge"); - return 1; - } + TRY(Core::System::pledge("stdio recvfd sendfd rpath cpath unix proc exec thread", nullptr)); Core::LockFile lockfile("/tmp/lock/assistant.lock"); @@ -205,7 +207,7 @@ int main(int argc, char** argv) return 0; } - auto app = GUI::Application::construct(argc, argv); + auto app = GUI::Application::construct(arguments); auto window = GUI::Window::construct(); window->set_minimizable(false); -- cgit v1.2.3