From ad16588f7734f0086d8cfa8ee10aaaa4961de23d Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 4 Nov 2014 20:40:11 -0600 Subject: Making the timer callback anonymous --- tests/indicator-fixture.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'tests/indicator-fixture.h') diff --git a/tests/indicator-fixture.h b/tests/indicator-fixture.h index 063a966..6b3963a 100644 --- a/tests/indicator-fixture.h +++ b/tests/indicator-fixture.h @@ -105,18 +105,16 @@ class IndicatorFixture : public ::testing::Test } private: - static gboolean _loop_quit (gpointer user_data) { - g_warning("Menu Timeout"); - g_main_loop_quit((GMainLoop *)user_data); - return G_SOURCE_CONTINUE; - } - void waitForCore (GObject * obj, const gchar * signalname) { auto loop = g_main_loop_new(nullptr, FALSE); /* Our two exit criteria */ gulong signal = g_signal_connect_swapped(obj, signalname, G_CALLBACK(g_main_loop_quit), loop); - guint timer = g_timeout_add_seconds(5, _loop_quit, loop); + guint timer = g_timeout_add_seconds(5, [](gpointer user_data) -> gboolean { + g_warning("Menu Timeout"); + g_main_loop_quit((GMainLoop *)user_data); + return G_SOURCE_CONTINUE; + }, loop); /* Wait for sync */ g_main_loop_run(loop); -- cgit v1.2.3