aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-09-28 14:57:25 +0200
committerAleksander Morgado <aleksander@lanedo.com>2012-09-28 14:57:25 +0200
commit00a8ed3af44835ccb83c05c2ecfec2a119320420 (patch)
tree8af6d216cc500aa8003c4b29abf927dd1ffb89f3 /src
parent65c3976cad2ed5ee14b979270b73d5c2a93ed215 (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mm-iface-modem.c7
1 files changed, 6 insertions, 1 deletions
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 */