aboutsummaryrefslogtreecommitdiff
path: root/libmm-common/mm-common-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-02-09 23:45:15 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-03-15 14:15:03 +0100
commit23508ddd7f208c4dcc88ce38a20c0ec4fc49582f (patch)
tree463b6a6b964ee7a6faf365ca249d1893b6f88962 /libmm-common/mm-common-helpers.c
parent1e5756c33b3059e661d47f7ae110a5fe75dc5231 (diff)
libmm-common: new helpers to work with SMS storage strings
Diffstat (limited to 'libmm-common/mm-common-helpers.c')
-rw-r--r--libmm-common/mm-common-helpers.c24
1 files changed, 24 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)