From 00a8ed3af44835ccb83c05c2ecfec2a119320420 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 28 Sep 2012 14:57:25 +0200 Subject: iface-modem: ensure the state change is flushed before the detailed notify In order to ease the life for clients listening to the 'state-changed' signal, the change in the 'state' property in the DBus interface skeleton is flushed right away, before emitting 'state-changed'. By doing this we make sure that the 'state-changed' callbacks in the clients are able to see exactly the same current state in the modem proxy. --- src/mm-iface-modem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mm-iface-modem.c b/src/mm-iface-modem.c index 5a2b2bd8..258a35c8 100644 --- a/src/mm-iface-modem.c +++ b/src/mm-iface-modem.c @@ -1001,11 +1001,16 @@ mm_iface_modem_update_state (MMIfaceModem *self, NULL); /* Signal status change */ - if (skeleton) + if (skeleton) { + /* Flush current change before signaling the state change, + * so that clients get the proper state already in the + * state-changed callback */ + g_dbus_interface_skeleton_flush (G_DBUS_INTERFACE_SKELETON (skeleton)); mm_gdbus_modem_emit_state_changed (skeleton, old_state, new_state, reason); + } /* If we go to registered state (from unregistered), setup signal * quality and access technologies periodic retrieval */ -- cgit v1.2.3-70-g09d2