diff options
author | Ted Gould <ted@gould.cx> | 2014-11-04 20:40:11 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2014-11-04 20:40:11 -0600 |
commit | ad16588f7734f0086d8cfa8ee10aaaa4961de23d (patch) | |
tree | 309920f2a2c347902bf5f7f571eb99b70db99d9b | |
parent | 730b3c7005e53e7f76db15b39499b62ccd4c49d2 (diff) | |
download | ayatana-indicator-sound-ad16588f7734f0086d8cfa8ee10aaaa4961de23d.tar.gz ayatana-indicator-sound-ad16588f7734f0086d8cfa8ee10aaaa4961de23d.tar.bz2 ayatana-indicator-sound-ad16588f7734f0086d8cfa8ee10aaaa4961de23d.zip |
Making the timer callback anonymous
-rw-r--r-- | tests/indicator-fixture.h | 12 |
1 files changed, 5 insertions, 7 deletions
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); |