bearer-cdma: allow subclasses to use the same unique path generator

This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:48 +01:00
parent 91eb041a63
commit 56956a36ad
2 changed files with 14 additions and 2 deletions
+11 -2
View File
@@ -94,6 +94,16 @@ disconnect (MMBearer *self,
/*****************************************************************************/
gchar *
mm_bearer_cdma_new_unique_path (void)
{
static guint id = 0;
return g_strdup_printf (MM_DBUS_BEARER_CDMA_PREFIX "/%d", id++);
}
/*****************************************************************************/
MMBearer *
mm_bearer_cdma_new_finish (MMIfaceModemCdma *modem,
GAsyncResult *res,
@@ -112,7 +122,6 @@ mm_bearer_cdma_new (MMIfaceModemCdma *modem,
gpointer user_data)
{
GSimpleAsyncResult *result;
static guint id = 0;
MMBearerCdma *bearer;
gchar *path;
@@ -129,7 +138,7 @@ mm_bearer_cdma_new (MMIfaceModemCdma *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_CDMA_PREFIX "/%d", id++);
path = mm_bearer_cdma_new_unique_path ();
g_object_set (bearer,
MM_BEARER_PATH, path,
MM_BEARER_MODEM, modem,
+3
View File
@@ -51,6 +51,9 @@ struct _MMBearerCdmaClass {
GType mm_bearer_cdma_get_type (void);
/* Getter for an unique CDMA Bearer path */
gchar *mm_bearer_cdma_new_unique_path (void);
/* Default CDMA bearer creation implementation */
void mm_bearer_cdma_new (MMIfaceModemCdma *modem,
MMCommonBearerProperties *properties,