Jelajahi Sumber

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

Use the updated API everywhere we are currently manually passing in
`arguments.argc` and `arguments.argv`.
Mustafa Quraish 3 tahun lalu
induk
melakukan
4d302e0e88

+ 1 - 1
Userland/Applets/ResourceGraph/main.cpp

@@ -187,7 +187,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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));
 

+ 1 - 1
Userland/Applications/3DFileViewer/main.cpp

@@ -284,7 +284,7 @@ bool GLContextWidget::load_file(Core::File& file, String const& filename)
 
 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));
 

+ 1 - 1
Userland/Applications/Browser/main.cpp

@@ -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.parse(arguments);
 
-    auto app = GUI::Application::construct(arguments.argc, arguments.argv);
+    auto app = GUI::Application::construct(arguments);
 
     Config::pledge_domains("Browser");
 

+ 1 - 1
Userland/Applications/FileManager/main.cpp

@@ -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.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));
 

+ 1 - 1
Userland/Applications/Mail/main.cpp

@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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");
 

+ 1 - 1
Userland/Applications/PDFViewer/main.cpp

@@ -17,7 +17,7 @@
 
 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 window = GUI::Window::construct();

+ 1 - 1
Userland/Applications/Piano/main.cpp

@@ -29,7 +29,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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;
 

+ 1 - 1
Userland/Applications/PixelPaint/main.cpp

@@ -23,7 +23,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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");
 
     const char* image_file = nullptr;

+ 1 - 1
Userland/Applications/Terminal/main.cpp

@@ -261,7 +261,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     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));
 

+ 1 - 1
Userland/Demos/Starfield/Starfield.cpp

@@ -162,7 +162,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
     args_parser.add_option(speed, "Speed (default = 1)", "speed", 's', "number");
     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));
 

+ 1 - 1
Userland/Games/2048/main.cpp

@@ -30,7 +30,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 
     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 window = GUI::Window::construct();

+ 1 - 1
Userland/Games/Breakout/main.cpp

@@ -18,7 +18,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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));
 

+ 1 - 1
Userland/Games/Chess/main.cpp

@@ -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));
 
-    auto app = GUI::Application::construct(arguments.argc, arguments.argv);
+    auto app = GUI::Application::construct(arguments);
 
     Config::pledge_domains("Chess");
 

+ 1 - 1
Userland/Games/Minesweeper/main.cpp

@@ -26,7 +26,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
 {
     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");