aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2025-05-20 09:03:55 +0200
committerDan Williams <dan@ioncontrol.co>2025-05-23 14:15:14 -0500
commit68d241b5aa69030b93deb06c6dc87568f824f7d6 (patch)
tree7ec36f4c93d79577ece605264198009f8a481e0a
parent9625c81d39c27449e0b70426e7084a9d7450ef75 (diff)
mmcbmmonitor: Print language when available
Signed-off-by: Guido Günther <agx@sigxcpu.org>
-rw-r--r--test/mmcbmmonitor.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/test/mmcbmmonitor.c b/test/mmcbmmonitor.c
index a118b410..ab8a5512 100644
--- a/test/mmcbmmonitor.c
+++ b/test/mmcbmmonitor.c
@@ -75,8 +75,16 @@ print_cbm (MMCbm *cbm)
g_print ("[%s] new cbm: %s\n",
mm_cbm_get_path (cbm),
mm_cbm_state_get_string (mm_cbm_get_state (cbm)));
- if (mm_cbm_get_state (cbm) == MM_CBM_STATE_RECEIVED)
- g_print(" %u: %s\n", mm_cbm_get_channel (cbm), mm_cbm_get_text (cbm));
+ if (mm_cbm_get_state (cbm) == MM_CBM_STATE_RECEIVED) {
+ const char *lang = mm_cbm_get_language (cbm);
+ g_autofree gchar *lang_info = g_strdup ("");
+
+ if (lang) {
+ g_free (lang_info);
+ lang_info = g_strdup_printf ("[%s]", lang);
+ }
+ g_print(" %u%s: %s\n", mm_cbm_get_channel (cbm), lang_info, mm_cbm_get_text (cbm));
+ }
}