aboutsummaryrefslogtreecommitdiff
path: root/src/mm-bearer.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-02-05 08:40:16 +0100
committerGuido Günther <agx@sigxcpu.org>2014-02-05 08:40:16 +0100
commitfa2b467e288cb137ffd792becbf0c1e757d85be4 (patch)
treece308eb0886e93805e7d88bccce48c93797fd6dd /src/mm-bearer.c
parentafc4b839a31c530d73b91aa2483795f185eb7e52 (diff)
New upstream version 1.2.0upstream/1.2.0upstream
Diffstat (limited to 'src/mm-bearer.c')
-rw-r--r--src/mm-bearer.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/mm-bearer.c b/src/mm-bearer.c
index 8c9a93c..6592619 100644
--- a/src/mm-bearer.c
+++ b/src/mm-bearer.c
@@ -441,7 +441,12 @@ disconnect_after_cancel_ready (MMBearer *self,
else
mm_dbg ("Disconnected bearer '%s'", self->priv->path);
- bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED);
+ /* Report disconnection to the bearer object using class method
+ * mm_bearer_report_connection_status. This gives subclass implementations a
+ * chance to correctly update their own connection state, in case this base
+ * class ignores a failed disconnection attempt.
+ */
+ mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
}
static void
@@ -945,7 +950,12 @@ disconnect_force_ready (MMBearer *self,
else
mm_dbg ("Disconnected bearer '%s'", self->priv->path);
- bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED);
+ /* Report disconnection to the bearer object using class method
+ * mm_bearer_report_connection_status. This gives subclass implementations a
+ * chance to correctly update their own connection state, in case this base
+ * class ignores a failed disconnection attempt.
+ */
+ mm_bearer_report_connection_status (self, MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
}
void
@@ -974,17 +984,25 @@ mm_bearer_disconnect_force (MMBearer *self)
/*****************************************************************************/
static void
-report_disconnection (MMBearer *self)
+report_connection_status (MMBearer *self,
+ MMBearerConnectionStatus status)
{
+ /* The only status expected at this point is DISCONNECTED.
+ * No other status should have been given to the generic implementation
+ * of report_connection_status (it would be an error).
+ */
+ g_assert (status == MM_BEARER_CONNECTION_STATUS_DISCONNECTED);
+
/* In the generic bearer implementation we just need to reset the
* interface status */
bearer_update_status (self, MM_BEARER_STATUS_DISCONNECTED);
}
void
-mm_bearer_report_disconnection (MMBearer *self)
+mm_bearer_report_connection_status (MMBearer *self,
+ MMBearerConnectionStatus status)
{
- return MM_BEARER_GET_CLASS (self)->report_disconnection (self);
+ return MM_BEARER_GET_CLASS (self)->report_connection_status (self, status);
}
static void
@@ -1160,7 +1178,7 @@ mm_bearer_class_init (MMBearerClass *klass)
object_class->finalize = finalize;
object_class->dispose = dispose;
- klass->report_disconnection = report_disconnection;
+ klass->report_connection_status = report_connection_status;
properties[PROP_CONNECTION] =
g_param_spec_object (MM_BEARER_CONNECTION,