mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-11 06:09:08 -07:00
Settings: Reload desktop keybinds without realloc
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi.h>
|
||||
#include <input/input.h>
|
||||
|
||||
#include "desktop_settings.h"
|
||||
|
||||
|
||||
@@ -109,7 +109,12 @@ static FuriString*
|
||||
void desktop_keybinds_load(Desktop* desktop, DesktopKeybinds* keybinds) {
|
||||
for(DesktopKeybindType type = 0; type < DesktopKeybindTypeMAX; type++) {
|
||||
for(DesktopKeybindKey key = 0; key < DesktopKeybindKeyMAX; key++) {
|
||||
(*keybinds)[type][key] = furi_string_alloc_set(desktop_keybinds_defaults[type][key]);
|
||||
const char* default_keybind = desktop_keybinds_defaults[type][key];
|
||||
if((*keybinds)[type][key]) {
|
||||
furi_string_set((*keybinds)[type][key], default_keybind);
|
||||
} else {
|
||||
(*keybinds)[type][key] = furi_string_alloc_set(default_keybind);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <furi/core/string.h>
|
||||
#include <input/input.h>
|
||||
|
||||
#include "desktop.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user