aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-13 22:16:59 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:05 +0100
commit66b2b7fb23e30c63eb7e852e4cc42c94e5f2bd41 (patch)
tree847fa8b04a6039aaadd134c8fad7acf0b47ce286 /src
parent20d8fd92bf76cd98eb0a3ab21827284a7d7ab635 (diff)
base-modem: also signal validity when reporting invalid
Otherwise the manager won't catch invalid modems failing at initialization.
Diffstat (limited to 'src')
-rw-r--r--src/mm-base-modem.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mm-base-modem.c b/src/mm-base-modem.c
index 73e0bbc1..6ad8507d 100644
--- a/src/mm-base-modem.c
+++ b/src/mm-base-modem.c
@@ -400,7 +400,10 @@ mm_base_modem_set_valid (MMBaseModem *self,
{
g_return_if_fail (MM_IS_BASE_MODEM (self));
- if (self->priv->valid != new_valid) {
+ /* If validity changed OR if both old and new were invalid, notify. This
+ * last case is to cover failures during initialization. */
+ if (self->priv->valid != new_valid ||
+ !new_valid) {
self->priv->valid = new_valid;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_VALID]);
}