bearer-3gpp: avoid the need of the modem object during new_finish()

This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:48 +01:00
parent ba9bdb37a9
commit 91eb041a63
5 changed files with 24 additions and 23 deletions
+2 -2
View File
@@ -785,8 +785,7 @@ mm_bearer_3gpp_new_unique_path (void)
}
MMBearer *
mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem,
GAsyncResult *res,
mm_bearer_3gpp_new_finish (GAsyncResult *res,
GError **error)
{
if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error))
@@ -798,6 +797,7 @@ mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem,
void
mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
MMCommonBearerProperties *properties,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
+2 -2
View File
@@ -59,10 +59,10 @@ gchar *mm_bearer_3gpp_new_unique_path (void);
/* Default 3GPP bearer creation implementation */
void mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
MMCommonBearerProperties *properties,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
MMBearer *mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem,
GAsyncResult *res,
MMBearer *mm_bearer_3gpp_new_finish (GAsyncResult *res,
GError **error);
const gchar *mm_bearer_3gpp_get_apn (MMBearer3gpp *self);
+2 -2
View File
@@ -4660,8 +4660,8 @@ iface_modem_3gpp_init (MMIfaceModem3gpp *iface)
iface->register_in_network_finish = register_in_network_finish;
iface->scan_networks = scan_networks;
iface->scan_networks_finish = scan_networks_finish;
iface->create_3gpp_bearer = mm_bearer_3gpp_new;
iface->create_3gpp_bearer_finish = mm_bearer_3gpp_new_finish;
iface->bearer_new = mm_bearer_3gpp_new;
iface->bearer_new_finish = mm_bearer_3gpp_new_finish;
}
static void
+10 -9
View File
@@ -369,10 +369,10 @@ mm_iface_modem_3gpp_create_bearer_finish (MMIfaceModem3gpp *self,
MMModem3gppRegistrationState current_state;
MMBearer *bearer;
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_3gpp_bearer_finish != NULL);
bearer = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_3gpp_bearer_finish (self,
res,
error);
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->bearer_new_finish != NULL);
bearer = MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->bearer_new_finish (res,
error);
if (!bearer)
return NULL;
@@ -405,11 +405,12 @@ mm_iface_modem_3gpp_create_bearer (MMIfaceModem3gpp *self,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_3gpp_bearer != NULL);
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->create_3gpp_bearer (self,
properties,
callback,
user_data);
g_assert (MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->bearer_new != NULL);
MM_IFACE_MODEM_3GPP_GET_INTERFACE (self)->bearer_new (self,
properties,
NULL,
callback,
user_data);
}
/*****************************************************************************/
+8 -8
View File
@@ -171,14 +171,14 @@ struct _MMIfaceModem3gpp {
GAsyncResult *res,
GError **error);
/* Create 3GPP bearer */
void (* create_3gpp_bearer) (MMIfaceModem3gpp *self,
MMCommonBearerProperties *properties,
GAsyncReadyCallback callback,
gpointer user_data);
MMBearer * (* create_3gpp_bearer_finish) (MMIfaceModem3gpp *self,
GAsyncResult *res,
GError **error);
/* New 3GPP bearer */
void (* bearer_new) (MMIfaceModem3gpp *self,
MMCommonBearerProperties *properties,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
MMBearer * (* bearer_new_finish) (GAsyncResult *res,
GError **error);
};
GType mm_iface_modem_3gpp_get_type (void);