Skip to content

Commit 4b15dd2

Browse files
committed
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.
1 parent fa13e19 commit 4b15dd2

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

Applications/About/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ int main(int argc, char** argv)
3939
quit_button->set_caption("Okay");
4040
quit_button->set_relative_rect(80, 100, widget->width() - 160, 20);
4141
quit_button->on_click = [] (GButton&) {
42-
GApplication::the().exit(0);
42+
GApplication::the().quit(0);
4343
};
4444

4545
window->show();

Applications/FileManager/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main(int argc, char** argv)
1919

2020
auto app_menu = make<GMenu>("FileManager");
2121
app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) {
22-
GApplication::the().exit(0);
22+
GApplication::the().quit(0);
2323
return;
2424
}));
2525
menubar->add_menu(move(app_menu));

Applications/Terminal/Terminal.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Terminal::Terminal(int ptm_fd)
2727
if (nread < 0) {
2828
dbgprintf("Terminal read error: %s\n", strerror(errno));
2929
perror("read(ptm)");
30-
GApplication::the().exit(1);
30+
GApplication::the().quit(1);
3131
return;
3232
}
3333
if (nread == 0) {
3434
dbgprintf("Terminal: EOF on master pty, closing.\n");
35-
GApplication::the().exit(0);
35+
GApplication::the().quit(0);
3636
return;
3737
}
3838
for (ssize_t i = 0; i < nread; ++i)

Applications/Terminal/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ int main(int argc, char** argv)
9898
auto app_menu = make<GMenu>("Terminal");
9999
app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) {
100100
dbgprintf("Terminal: Quit menu activated!\n");
101-
GApplication::the().exit(0);
101+
GApplication::the().quit(0);
102102
return;
103103
}));
104104
menubar->add_menu(move(app_menu));

LibGUI/GApplication.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ int GApplication::exec()
2626
return m_event_loop->exec();
2727
}
2828

29-
void GApplication::exit(int exit_code)
29+
void GApplication::quit(int exit_code)
3030
{
31-
m_event_loop->exit(exit_code);
31+
m_event_loop->quit(exit_code);
3232
}
3333

3434
void GApplication::set_menubar(OwnPtr<GMenuBar>&& menubar)

LibGUI/GApplication.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class GApplication {
1212
~GApplication();
1313

1414
int exec();
15-
void exit(int);
15+
void quit(int);
1616

1717
void set_menubar(OwnPtr<GMenuBar>&&);
1818

LibGUI/GEventLoop.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ GEventLoop& GEventLoop::main()
6666
return *s_mainGEventLoop;
6767
}
6868

69-
void GEventLoop::exit(int code)
69+
void GEventLoop::quit(int code)
7070
{
7171
m_exit_requested = true;
7272
m_exit_code = code;
@@ -257,7 +257,7 @@ void GEventLoop::wait_for_event()
257257
if (event.type == WSAPI_ServerMessage::Error) {
258258
dbgprintf("GEventLoop got error message from server\n");
259259
dbgprintf(" - error message: %s\n", String(event.text, event.text_length).characters());
260-
exit(1);
260+
quit(1);
261261
return;
262262
}
263263

@@ -307,7 +307,7 @@ bool GEventLoop::drain_messages_from_server()
307307
ssize_t nread = read(m_event_fd, &message, sizeof(WSAPI_ServerMessage));
308308
if (nread < 0) {
309309
perror("read");
310-
exit(1);
310+
quit(1);
311311
return false;
312312
}
313313
if (nread == 0)

LibGUI/GEventLoop.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class GEventLoop {
3232
void register_notifier(Badge<GNotifier>, GNotifier&);
3333
void unregister_notifier(Badge<GNotifier>, GNotifier&);
3434

35-
void exit(int);
35+
void quit(int);
3636

3737
bool post_message_to_server(const WSAPI_ClientMessage&);
3838
bool wait_for_specific_event(WSAPI_ServerMessage::Type, WSAPI_ServerMessage&);

LibGUI/GWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ void GWindow::close()
4646
// FIXME: If we exit the event loop, we're never gonna deal with the delete_later request!
4747
// This will become relevant once we support nested event loops.
4848
if (should_exit_app_on_close())
49-
GEventLoop::main().exit(0);
49+
GEventLoop::main().quit(0);
5050
delete_later();
5151
}
5252

0 commit comments

Comments
 (0)