diff options
-rw-r--r-- | libmm-common/mm-common-helpers.c | 24 | ||||
-rw-r--r-- | libmm-common/mm-common-helpers.h | 3 |
2 files changed, 27 insertions, 0 deletions
diff --git a/libmm-common/mm-common-helpers.c b/libmm-common/mm-common-helpers.c index 86519b27..1d3361e1 100644 --- a/libmm-common/mm-common-helpers.c +++ b/libmm-common/mm-common-helpers.c @@ -45,6 +45,30 @@ mm_common_build_bands_string (const MMModemBand *bands, return g_string_free (str, FALSE); } +gchar * +mm_common_build_sms_storages_string (const MMSmsStorage *storages, + guint n_storages) +{ + gboolean first = TRUE; + GString *str; + guint i; + + if (!storages || !n_storages) + return g_strdup ("none"); + + str = g_string_new (""); + for (i = 0; i < n_storages; i++) { + g_string_append_printf (str, "%s%s", + first ? "" : ", ", + mm_sms_storage_get_string (storages[i])); + + if (first) + first = FALSE; + } + + return g_string_free (str, FALSE); +} + MMModemMode mm_common_get_modes_from_string (const gchar *str, GError **error) diff --git a/libmm-common/mm-common-helpers.h b/libmm-common/mm-common-helpers.h index fa39a7be..e7ed4197 100644 --- a/libmm-common/mm-common-helpers.h +++ b/libmm-common/mm-common-helpers.h @@ -22,6 +22,9 @@ gchar *mm_common_build_bands_string (const MMModemBand *bands, guint n_bands); +gchar *mm_common_build_sms_storages_string (const MMSmsStorage *storages, + guint n_storages); + MMModemMode mm_common_get_modes_from_string (const gchar *str, GError **error); void mm_common_get_bands_from_string (const gchar *str, |