Desktop: Fix disabling keybinds

Turns out, flipper format does not allow empty value strings
This commit is contained in:
Willy-JL
2024-08-27 00:37:42 +02:00
parent c5f6d84920
commit e7267108c5
3 changed files with 9 additions and 91 deletions

View File

@@ -36,7 +36,9 @@ void desktop_keybinds_migrate(Desktop* desktop) {
for(DesktopKeybindType type = 0; type < DesktopKeybindTypeMAX; type++) {
for(DesktopKeybindKey key = 0; key < DesktopKeybindKeyMAX; key++) {
FuriString* keybind = furi_string_alloc_set(old[type][key].data);
if(furi_string_equal(keybind, EXT_PATH("apps/Misc/nightstand.fap"))) {
if(furi_string_empty(keybind)) {
furi_string_set_str(keybind, "_");
} else if(furi_string_equal(keybind, EXT_PATH("apps/Misc/nightstand.fap"))) {
furi_string_set(keybind, "Clock");
} else if(furi_string_equal(keybind, "RFID")) {
furi_string_set(keybind, "125 kHz RFID");
@@ -66,8 +68,8 @@ const char* desktop_keybinds_defaults[DesktopKeybindTypeMAX][DesktopKeybindKeyMA
},
[DesktopKeybindTypeHold] =
{
[DesktopKeybindKeyUp] = "",
[DesktopKeybindKeyDown] = "",
[DesktopKeybindKeyUp] = "_",
[DesktopKeybindKeyDown] = "_",
[DesktopKeybindKeyRight] = "Device Info",
[DesktopKeybindKeyLeft] = "Lock with PIN",
},
@@ -197,7 +199,7 @@ void desktop_run_keybind(Desktop* desktop, InputType _type, InputKey _key) {
DesktopKeybindKey key = keybind_keys[_key];
FuriString* keybind = desktop_keybinds_load_one(desktop, type, key);
if(furi_string_empty(keybind)) {
if(furi_string_equal(keybind, "_")) {
} else if(furi_string_equal(keybind, "Apps Menu")) {
loader_start_detached_with_gui_error(desktop->loader, LOADER_APPLICATIONS_NAME, NULL);
} else if(furi_string_equal(keybind, "Archive")) {