mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:37:43 +00:00
Everywhere: Replace most cases of exit() with Application::quit()
Application::quit() is nicer for most cases where exit() is used. Cases where exit() is used intentionally for early termination are left intact.
This commit is contained in:
parent
2caafacd9b
commit
73c1b1617a
5 changed files with 12 additions and 11 deletions
|
@ -250,7 +250,7 @@ int main(int argc, char** argv)
|
||||||
if (!app_state.selected_index.has_value())
|
if (!app_state.selected_index.has_value())
|
||||||
return;
|
return;
|
||||||
app_state.results[app_state.selected_index.value()].activate();
|
app_state.results[app_state.selected_index.value()].activate();
|
||||||
exit(0);
|
GUI::Application::the()->quit();
|
||||||
};
|
};
|
||||||
text_box.on_up_pressed = [&]() {
|
text_box.on_up_pressed = [&]() {
|
||||||
if (!app_state.visible_result_count)
|
if (!app_state.visible_result_count)
|
||||||
|
@ -278,7 +278,7 @@ int main(int argc, char** argv)
|
||||||
mark_selected_item();
|
mark_selected_item();
|
||||||
};
|
};
|
||||||
text_box.on_escape_pressed = []() {
|
text_box.on_escape_pressed = []() {
|
||||||
exit(0);
|
GUI::Application::the()->quit();
|
||||||
};
|
};
|
||||||
|
|
||||||
db.on_new_results = [&](auto results) {
|
db.on_new_results = [&](auto results) {
|
||||||
|
@ -298,7 +298,7 @@ int main(int argc, char** argv)
|
||||||
match.set_subtitle(result.subtitle());
|
match.set_subtitle(result.subtitle());
|
||||||
match.on_selected = [&result]() {
|
match.on_selected = [&result]() {
|
||||||
result.activate();
|
result.activate();
|
||||||
exit(0);
|
GUI::Application::the()->quit();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,8 +73,10 @@ void IRCAppWindow::setup_client()
|
||||||
|
|
||||||
if (m_client->hostname().is_empty()) {
|
if (m_client->hostname().is_empty()) {
|
||||||
String value;
|
String value;
|
||||||
if (GUI::InputBox::show(this, value, "Enter server:", "Connect to server") == GUI::InputBox::ExecCancel)
|
if (GUI::InputBox::show(this, value, "Enter server:", "Connect to server") == GUI::InputBox::ExecCancel) {
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
m_client->set_server(value, 6667);
|
m_client->set_server(value, 6667);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,18 +52,18 @@ void Screensaver::mousemove_event(GUI::MouseEvent& event)
|
||||||
if (m_mouse_origin.is_null()) {
|
if (m_mouse_origin.is_null()) {
|
||||||
m_mouse_origin = event.position();
|
m_mouse_origin = event.position();
|
||||||
} else if (event.position().distance_from(m_mouse_origin) > max_distance_move) {
|
} else if (event.position().distance_from(m_mouse_origin) > max_distance_move) {
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screensaver::mousedown_event(GUI::MouseEvent&)
|
void Screensaver::mousedown_event(GUI::MouseEvent&)
|
||||||
{
|
{
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screensaver::keydown_event(GUI::KeyEvent&)
|
void Screensaver::keydown_event(GUI::KeyEvent&)
|
||||||
{
|
{
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Screensaver::paint_event(GUI::PaintEvent& event)
|
void Screensaver::paint_event(GUI::PaintEvent& event)
|
||||||
|
|
|
@ -79,12 +79,12 @@ void Starfield::mousemove_event(GUI::MouseEvent&)
|
||||||
|
|
||||||
void Starfield::mousedown_event(GUI::MouseEvent&)
|
void Starfield::mousedown_event(GUI::MouseEvent&)
|
||||||
{
|
{
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Starfield::keydown_event(GUI::KeyEvent&)
|
void Starfield::keydown_event(GUI::KeyEvent&)
|
||||||
{
|
{
|
||||||
::exit(0);
|
GUI::Application::the()->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Starfield::paint_event(GUI::PaintEvent& event)
|
void Starfield::paint_event(GUI::PaintEvent& event)
|
||||||
|
|
|
@ -34,7 +34,6 @@ void ClientConnection::die()
|
||||||
{
|
{
|
||||||
s_connections.remove(client_id());
|
s_connections.remove(client_id());
|
||||||
GUI::Application::the()->quit();
|
GUI::Application::the()->quit();
|
||||||
exit(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RefPtr<GUI::Window> ClientConnection::create_dummy_child_window(i32 window_server_client_id, i32 parent_window_id)
|
RefPtr<GUI::Window> ClientConnection::create_dummy_child_window(i32 window_server_client_id, i32 parent_window_id)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue