diff options
author | Lucas CHOLLET <lucas.chollet@free.fr> | 2023-05-05 00:24:53 -0400 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-05-05 16:41:21 +0100 |
commit | 1a97382305f517dcc4c4f71746b6ab5d96012b0d (patch) | |
tree | 71bc8573bea401d8a27847c1dadeeceb518fd1a0 /Userland/Applications/PDFViewer | |
parent | f132751faeaa486c3eebc1ed23117efe9701da22 (diff) | |
download | serenity-1a97382305f517dcc4c4f71746b6ab5d96012b0d.zip |
LibGUI: Make `Application`'s construction fallible
The pattern to construct `Application` was to use the `try_create`
method from the `C_OBJECT` macro. While being safe from an OOM
perspective, this method doesn't propagate errors from the constructor.
This patch make `Application` use the `C_OBJECT_ABSTRACT` and manually
define a `create` method that can bubble up errors from the
construction stage.
This commit also removes the ability to use `argc` and `argv` to
create an `Application`, only `Main`'s `Arguments` can be used.
From a user point of view, the patch renames `try_create` => `create`,
hence the huge number of modified files.
Diffstat (limited to 'Userland/Applications/PDFViewer')
-rw-r--r-- | Userland/Applications/PDFViewer/main.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/PDFViewer/main.cpp b/Userland/Applications/PDFViewer/main.cpp index 456249e100..1910989797 100644 --- a/Userland/Applications/PDFViewer/main.cpp +++ b/Userland/Applications/PDFViewer/main.cpp @@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) args_parser.add_positional_argument(file_path, "PDF file to open", "path", Core::ArgsParser::Required::No); args_parser.parse(arguments); - auto app = TRY(GUI::Application::try_create(arguments)); + auto app = TRY(GUI::Application::create(arguments)); auto app_icon = GUI::Icon::default_icon("app-pdf-viewer"sv); Config::pledge_domain("PDFViewer"); |