1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Everywhere: Use Application::construct() with Main::Arguments directly

Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
This commit is contained in:
Mustafa Quraish 2021-11-22 19:11:16 -05:00 committed by Brian Gianforcaro
parent 2fbcab46bf
commit 4d302e0e88
14 changed files with 14 additions and 14 deletions

View file

@ -187,7 +187,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio recvfd sendfd proc exec rpath unix", nullptr)); TRY(System::pledge("stdio recvfd sendfd proc exec rpath unix", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio recvfd sendfd proc exec rpath", nullptr)); TRY(System::pledge("stdio recvfd sendfd proc exec rpath", nullptr));

View file

@ -284,7 +284,7 @@ bool GLContextWidget::load_file(Core::File& file, String const& filename)
ErrorOr<int> serenity_main(Main::Arguments arguments) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio thread recvfd sendfd rpath unix", nullptr)); TRY(System::pledge("stdio thread recvfd sendfd rpath unix", nullptr));

View file

@ -47,7 +47,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No); args_parser.add_positional_argument(specified_url, "URL to open", "url", Core::ArgsParser::Required::No);
args_parser.parse(arguments); args_parser.parse(arguments);
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
Config::pledge_domains("Browser"); Config::pledge_domains("Browser");

View file

@ -80,7 +80,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_positional_argument(initial_location, "Path to open", "path", Core::ArgsParser::Required::No); args_parser.add_positional_argument(initial_location, "Path to open", "path", Core::ArgsParser::Required::No);
args_parser.parse(arguments); args_parser.parse(arguments);
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio thread recvfd sendfd cpath rpath wpath fattr proc exec unix", nullptr)); TRY(System::pledge("stdio thread recvfd sendfd cpath rpath wpath fattr proc exec unix", nullptr));

View file

@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio recvfd sendfd rpath unix inet", nullptr)); TRY(System::pledge("stdio recvfd sendfd rpath unix inet", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
Config::pledge_domains("Mail"); Config::pledge_domains("Mail");

View file

@ -17,7 +17,7 @@
ErrorOr<int> serenity_main(Main::Arguments arguments) ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
auto app_icon = GUI::Icon::default_icon("app-pdf-viewer"); auto app_icon = GUI::Icon::default_icon("app-pdf-viewer");
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();

View file

@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio thread rpath cpath wpath recvfd sendfd unix", nullptr)); TRY(System::pledge("stdio thread rpath cpath wpath recvfd sendfd unix", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TrackManager track_manager; TrackManager track_manager;

View file

@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath", nullptr)); TRY(System::pledge("stdio thread recvfd sendfd rpath unix wpath cpath", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
Config::pledge_domains("PixelPaint"); Config::pledge_domains("PixelPaint");
const char* image_file = nullptr; const char* image_file = nullptr;

View file

@ -261,7 +261,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
TRY(System::sigaction(SIGCHLD, &act, nullptr)); TRY(System::sigaction(SIGCHLD, &act, nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio tty rpath cpath wpath recvfd sendfd proc exec unix", nullptr)); TRY(System::pledge("stdio tty rpath cpath wpath recvfd sendfd proc exec unix", nullptr));

View file

@ -162,7 +162,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
args_parser.add_option(speed, "Speed (default = 1)", "speed", 's', "number"); args_parser.add_option(speed, "Speed (default = 1)", "speed", 's', "number");
args_parser.parse(arguments); args_parser.parse(arguments);
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio recvfd sendfd rpath", nullptr)); TRY(System::pledge("stdio recvfd sendfd rpath", nullptr));

View file

@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
srand(time(nullptr)); srand(time(nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
auto app_icon = GUI::Icon::default_icon("app-2048"); auto app_icon = GUI::Icon::default_icon("app-2048");
auto window = GUI::Window::construct(); auto window = GUI::Window::construct();

View file

@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio recvfd sendfd rpath unix", nullptr)); TRY(System::pledge("stdio recvfd sendfd rpath unix", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
TRY(System::pledge("stdio recvfd sendfd rpath", nullptr)); TRY(System::pledge("stdio recvfd sendfd rpath", nullptr));

View file

@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio rpath wpath cpath recvfd sendfd thread proc exec unix", nullptr)); TRY(System::pledge("stdio rpath wpath cpath recvfd sendfd thread proc exec unix", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
Config::pledge_domains("Chess"); Config::pledge_domains("Chess");

View file

@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
{ {
TRY(System::pledge("stdio rpath recvfd sendfd unix", nullptr)); TRY(System::pledge("stdio rpath recvfd sendfd unix", nullptr));
auto app = GUI::Application::construct(arguments.argc, arguments.argv); auto app = GUI::Application::construct(arguments);
Config::pledge_domains("Minesweeper"); Config::pledge_domains("Minesweeper");