1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 12:45:07 +00:00

LibGUI: Rename GEventLoop::exit() and GApplication::exit() to quit().

These functions don't exit immediately, but rather on the next iteration
of the event loop.

Since exit() is already used by the standard library, let's call it quit()
instead. That way, saying exit() means the same thing here as anywhere else.
This commit is contained in:
Andreas Kling 2019-02-17 09:58:35 +01:00
parent fa13e1977e
commit 4b15dd2bca
9 changed files with 13 additions and 13 deletions

View file

@ -39,7 +39,7 @@ int main(int argc, char** argv)
quit_button->set_caption("Okay");
quit_button->set_relative_rect(80, 100, widget->width() - 160, 20);
quit_button->on_click = [] (GButton&) {
GApplication::the().exit(0);
GApplication::the().quit(0);
};
window->show();

View file

@ -19,7 +19,7 @@ int main(int argc, char** argv)
auto app_menu = make<GMenu>("FileManager");
app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) {
GApplication::the().exit(0);
GApplication::the().quit(0);
return;
}));
menubar->add_menu(move(app_menu));

View file

@ -27,12 +27,12 @@ Terminal::Terminal(int ptm_fd)
if (nread < 0) {
dbgprintf("Terminal read error: %s\n", strerror(errno));
perror("read(ptm)");
GApplication::the().exit(1);
GApplication::the().quit(1);
return;
}
if (nread == 0) {
dbgprintf("Terminal: EOF on master pty, closing.\n");
GApplication::the().exit(0);
GApplication::the().quit(0);
return;
}
for (ssize_t i = 0; i < nread; ++i)

View file

@ -98,7 +98,7 @@ int main(int argc, char** argv)
auto app_menu = make<GMenu>("Terminal");
app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) {
dbgprintf("Terminal: Quit menu activated!\n");
GApplication::the().exit(0);
GApplication::the().quit(0);
return;
}));
menubar->add_menu(move(app_menu));

View file

@ -26,9 +26,9 @@ int GApplication::exec()
return m_event_loop->exec();
}
void GApplication::exit(int exit_code)
void GApplication::quit(int exit_code)
{
m_event_loop->exit(exit_code);
m_event_loop->quit(exit_code);
}
void GApplication::set_menubar(OwnPtr<GMenuBar>&& menubar)

View file

@ -12,7 +12,7 @@ public:
~GApplication();
int exec();
void exit(int);
void quit(int);
void set_menubar(OwnPtr<GMenuBar>&&);

View file

@ -66,7 +66,7 @@ GEventLoop& GEventLoop::main()
return *s_mainGEventLoop;
}
void GEventLoop::exit(int code)
void GEventLoop::quit(int code)
{
m_exit_requested = true;
m_exit_code = code;
@ -257,7 +257,7 @@ void GEventLoop::wait_for_event()
if (event.type == WSAPI_ServerMessage::Error) {
dbgprintf("GEventLoop got error message from server\n");
dbgprintf(" - error message: %s\n", String(event.text, event.text_length).characters());
exit(1);
quit(1);
return;
}
@ -307,7 +307,7 @@ bool GEventLoop::drain_messages_from_server()
ssize_t nread = read(m_event_fd, &message, sizeof(WSAPI_ServerMessage));
if (nread < 0) {
perror("read");
exit(1);
quit(1);
return false;
}
if (nread == 0)

View file

@ -32,7 +32,7 @@ public:
void register_notifier(Badge<GNotifier>, GNotifier&);
void unregister_notifier(Badge<GNotifier>, GNotifier&);
void exit(int);
void quit(int);
bool post_message_to_server(const WSAPI_ClientMessage&);
bool wait_for_specific_event(WSAPI_ServerMessage::Type, WSAPI_ServerMessage&);

View file

@ -46,7 +46,7 @@ void GWindow::close()
// FIXME: If we exit the event loop, we're never gonna deal with the delete_later request!
// This will become relevant once we support nested event loops.
if (should_exit_app_on_close())
GEventLoop::main().exit(0);
GEventLoop::main().quit(0);
delete_later();
}