From 2570909e52b4121d69b0bc6638af8882dae87176 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 1 Apr 2024 09:35:45 -0400 Subject: [Feature] Add root_realpath to Rockbox Info Change-Id: I5a6bb78495a00960d0aa0f1a3fad227e4b8e17f3 --- apps/menus/main_menu.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 71763af0ee..73c9f7be33 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -137,6 +137,7 @@ enum infoscreenorder #ifdef HAVE_RECORDING INFO_REC_DIR, #endif + INFO_ROOT_DIR, INFO_VERSION, #if CONFIG_RTC INFO_DATE, @@ -241,7 +242,9 @@ static const char* info_getname(int selected_item, void *data, snprintf(buffer, buffer_len, "%s %s", str(LANG_REC_DIR), global_settings.rec_directory); break; #endif - + case INFO_ROOT_DIR: + snprintf(buffer, buffer_len, "%s %s", str(LANG_DISPLAY_FULL_PATH), root_realpath()); + break; case INFO_BUFFER: /* buffer */ { long kib = audio_buffer_size() >> 10; /* to KiB */ @@ -336,27 +339,14 @@ static int info_speak_item(int selected_item, void * data) talk_id(LANG_REC_DIR, false); if (global_settings.rec_directory[0]) { - long *pathsep = NULL; - char rec_directory[MAX_PATHNAME+1]; - char *s; - strcpy(rec_directory, global_settings.rec_directory); - s = rec_directory; - if ((strlen(s) > 1) && (s[strlen(s) - 1] == '/')) - s[strlen(s) - 1] = 0; - while (s) - { - s = strchr(s + 1, '/'); - if (s) - s[0] = 0; - talk_dir_or_spell(rec_directory, pathsep, true); - if (s) - s[0] = '/'; - pathsep = TALK_IDARRAY(VOICE_CHAR_SLASH); - } + talk_fullpath(global_settings.rec_directory, true); } break; #endif - + case INFO_ROOT_DIR: + talk_id(LANG_DISPLAY_FULL_PATH, false); + talk_fullpath(root_realpath(), true); + break; case INFO_BUFFER: /* buffer */ { talk_id(LANG_BUFFER_STAT, false); -- cgit v1.2.3