mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:57:45 +00:00
LibGUI: Make GUI::Application a Core::Object
Having this on the stack makes whole-program teardown iffy. Turning it into a Core::Object allows anyone who needs it to extends its lifetime.
This commit is contained in:
parent
0d577ab781
commit
1dd1595043
51 changed files with 140 additions and 138 deletions
|
@ -75,7 +75,7 @@ Options parse_options(int argc, char* argv[])
|
|||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
Options options = parse_options(argc, argv);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
auto f = Core::File::construct();
|
||||
bool success;
|
||||
|
@ -67,7 +67,7 @@ int main(int argc, char** argv)
|
|||
|
||||
auto& app_menu = menubar->add_menu("HTML");
|
||||
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) {
|
||||
app.quit();
|
||||
app->quit();
|
||||
}));
|
||||
|
||||
auto& help_menu = menubar->add_menu("Help");
|
||||
|
@ -75,9 +75,9 @@ int main(int argc, char** argv)
|
|||
GUI::AboutDialog::show("HTML", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-html.png"), window);
|
||||
}));
|
||||
|
||||
app.set_menubar(move(menubar));
|
||||
app->set_menubar(move(menubar));
|
||||
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"));
|
||||
|
||||
return app.exec();
|
||||
return app->exec();
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
const char* title = nullptr;
|
||||
|
|
|
@ -85,7 +85,7 @@ int main(int argc, char** argv)
|
|||
args_parser.add_positional_argument(name, "Wallpaper to set", "name", Core::ArgsParser::Required::No);
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
if (show_all)
|
||||
return handle_show_all();
|
||||
|
|
|
@ -41,7 +41,7 @@ int main(int argc, char* argv[])
|
|||
args_parser.add_option(no_newline, "Do not append a newline", "no-newline", 'n');
|
||||
args_parser.parse(argc, argv);
|
||||
|
||||
GUI::Application app(argc, argv);
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
|
||||
auto& clipboard = GUI::Clipboard::the();
|
||||
auto data_and_type = clipboard.data_and_type();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue