# HG changeset patch # User Christian Hammond # Date 1064962522 0 # Node ID 25a616f16b6c983c15007ed682035667c51ac810 # Parent 73da9c3ad9aca1a14238dcf06451b83933f60c51 [gaim-migrate @ 7647] Added more core wrappers for the glib mainloops, and replaced the last GTK+ code in OSCAR with them. committer: Tailor Script diff -r 73da9c3ad9ac -r 25a616f16b6c src/core.c --- a/src/core.c Tue Sep 30 22:49:00 2003 +0000 +++ b/src/core.c Tue Sep 30 22:55:22 2003 +0000 @@ -150,12 +150,25 @@ return VERSION; } +gboolean +gaim_core_mainloop_events_pending(void) +{ + return g_main_context_pending(g_main_context_default()); +} + void gaim_core_mainloop_iteration(void) { g_main_context_iteration(g_main_context_default(), FALSE); } +void +gaim_core_mainloop_finish_events(void) +{ + while (gaim_core_mainloop_events_pending()) + gaim_core_mainloop_iteration(); +} + const char * gaim_core_get_ui(void) { diff -r 73da9c3ad9ac -r 25a616f16b6c src/core.h --- a/src/core.h Tue Sep 30 22:49:00 2003 +0000 +++ b/src/core.h Tue Sep 30 22:55:22 2003 +0000 @@ -64,6 +64,13 @@ const char *gaim_core_get_version(void); /** + * Returns whether or not there are any mainloop events pending. + * + * @return TRUE if there are mainloop events pending. FALSE otherwise. + */ +gboolean gaim_core_mainloop_events_pending(void); + +/** * Iterates once through the gaim mainloop. * * This is in actuality a wrapper around glib's mainloop iteration @@ -74,6 +81,11 @@ void gaim_core_mainloop_iteration(void); /** + * Iterates through all remaining events in the mainloop. + */ +void gaim_core_mainloop_finish_events(void); + +/** * Returns the ID of the UI that is using the core. * * @return The ID of the UI that is currently using the core. diff -r 73da9c3ad9ac -r 25a616f16b6c src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Tue Sep 30 22:49:00 2003 +0000 +++ b/src/protocols/oscar/oscar.c Tue Sep 30 22:55:22 2003 +0000 @@ -5600,8 +5600,7 @@ dim->watcher = 0; } /* XXX is this really necessary? */ - while (gtk_events_pending()) - gtk_main_iteration(); + gaim_core_mainloop_finish_events(); c = gaim_find_conversation_with_account(sn, gaim_connection_get_account(gc)); if (c != NULL)