Shortcuts, Fix FS#13151 Deleting shortcut removes name, icon, talkclip

FS#13151 - Deleting item from shortcut menu corrupts the menu's display

The function that writes shortcut.txt didn't write existing
name, icon or talkclip items

Change-Id: I4418700c82f91522b2dd8a975548d7bd91f150d3
Now: writes all three supplying default values if the items don't exist
This commit is contained in:
William Wilgus 2018-12-10 12:04:55 -06:00
parent 4055f90f08
commit ce0b31d87d

View file

@ -235,6 +235,12 @@ static void shortcuts_ata_idle_callback(void)
write(fd, sc->u.setting->cfg_name, strlen(sc->u.setting->cfg_name));
else
write(fd, sc->u.path, strlen(sc->u.path));
/* write name:, icon:, talkclip: */
len = snprintf(buf, MAX_PATH, "\nname: %s\nicon: %d\ntalkclip: ",
sc->name, sc->icon);
write(fd, buf, len);
write(fd, sc->talk_clip, strlen(sc->talk_clip));
write(fd, "\n\n", 2);
}
close(fd);