bearer-3gpp: allow subclasses to use the same unique path generator
This commit is contained in:
@@ -776,6 +776,14 @@ disconnect (MMBearer *self,
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
gchar *
|
||||
mm_bearer_3gpp_new_unique_path (void)
|
||||
{
|
||||
static guint id = 0;
|
||||
|
||||
return g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++);
|
||||
}
|
||||
|
||||
MMBearer *
|
||||
mm_bearer_3gpp_new_finish (MMIfaceModem3gpp *modem,
|
||||
GAsyncResult *res,
|
||||
@@ -794,7 +802,6 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
|
||||
gpointer user_data)
|
||||
{
|
||||
GSimpleAsyncResult *result;
|
||||
static guint id = 0;
|
||||
MMBearer3gpp *bearer;
|
||||
gchar *path;
|
||||
|
||||
@@ -824,7 +831,7 @@ mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
|
||||
|
||||
/* Set modem and path ONLY after having checked input properties, so that
|
||||
* we don't export invalid bearers. */
|
||||
path = g_strdup_printf (MM_DBUS_BEARER_3GPP_PREFIX "/%d", id++);
|
||||
path = mm_bearer_3gpp_new_unique_path ();
|
||||
g_object_set (bearer,
|
||||
MM_BEARER_PATH, path,
|
||||
MM_BEARER_MODEM, modem,
|
||||
|
||||
@@ -53,6 +53,9 @@ struct _MMBearer3gppClass {
|
||||
|
||||
GType mm_bearer_3gpp_get_type (void);
|
||||
|
||||
/* Getter for an unique 3GPP Bearer path */
|
||||
gchar *mm_bearer_3gpp_new_unique_path (void);
|
||||
|
||||
/* Default 3GPP bearer creation implementation */
|
||||
void mm_bearer_3gpp_new (MMIfaceModem3gpp *modem,
|
||||
MMCommonBearerProperties *properties,
|
||||
|
||||
Reference in New Issue
Block a user