mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Fix: Shortcuts Menu data loss & crash
- Shortcuts Menu would delete SHORTCUT_TIME shortcuts when deleting any other shortcut. - Shortcuts would crash or show wrong number of items after deleting a shortcut and then launching a shortcut when simplelist_show_list was executed again. Change-Id: Ia87c94a364c516fd662cb3c7d245c566a3fa91ca
This commit is contained in:
parent
9ee321cf90
commit
687096e3f5
1 changed files with 14 additions and 0 deletions
|
@ -236,6 +236,19 @@ static void shortcuts_ata_idle_callback(void)
|
||||||
write(fd, buf, len);
|
write(fd, buf, len);
|
||||||
if (sc->type == SHORTCUT_SETTING)
|
if (sc->type == SHORTCUT_SETTING)
|
||||||
write(fd, sc->u.setting->cfg_name, strlen(sc->u.setting->cfg_name));
|
write(fd, sc->u.setting->cfg_name, strlen(sc->u.setting->cfg_name));
|
||||||
|
else if (sc->type == SHORTCUT_TIME)
|
||||||
|
{
|
||||||
|
#if CONFIG_RTC
|
||||||
|
if (sc->u.timedata.talktime)
|
||||||
|
write(fd, "talk", 4);
|
||||||
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
write(fd, "sleep ", 6);
|
||||||
|
len = snprintf(buf, MAX_PATH, "%d", sc->u.timedata.sleep_timeout);
|
||||||
|
write(fd, buf, len);
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
write(fd, sc->u.path, strlen(sc->u.path));
|
write(fd, sc->u.path, strlen(sc->u.path));
|
||||||
|
|
||||||
|
@ -599,6 +612,7 @@ int do_shortcut_menu(void *ignored)
|
||||||
|
|
||||||
while (done == GO_TO_PREVIOUS)
|
while (done == GO_TO_PREVIOUS)
|
||||||
{
|
{
|
||||||
|
list.count = shortcut_count;
|
||||||
if (simplelist_show_list(&list))
|
if (simplelist_show_list(&list))
|
||||||
break; /* some error happened?! */
|
break; /* some error happened?! */
|
||||||
if (list.selection == -1)
|
if (list.selection == -1)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue