[FL-2675] /int space reservation (#1448)
* storage: added global #defines for /int, /ext & /any * storage: introduced PATH_EXT, PATH_INT& PATH_ANY macros * core apps: moved hardcoded config files names to separate headers; prefixed them with "."; updater: added file name migration to new naming convention on backup extraction * storage: fixed storage_merge_recursive handling of complex directory structures; storage_move_to_sd: changed data migration logic to all non-dot files & all folders * core: added macro aliases for core record names * Bumped protobuf commit pointer * storage: reserved 5 pages in /int; denying write&creation of non-dot files when running out of free space Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
@@ -85,7 +85,7 @@ static bool
|
||||
}
|
||||
|
||||
static void infrared_find_vacant_remote_name(string_t name, const char* path) {
|
||||
Storage* storage = furi_record_open("storage");
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
string_t base_path;
|
||||
string_init_set_str(base_path, path);
|
||||
@@ -122,7 +122,7 @@ static void infrared_find_vacant_remote_name(string_t name, const char* path) {
|
||||
}
|
||||
|
||||
string_clear(base_path);
|
||||
furi_record_close("storage");
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
}
|
||||
|
||||
static Infrared* infrared_alloc() {
|
||||
@@ -140,7 +140,7 @@ static Infrared* infrared_alloc() {
|
||||
infrared->scene_manager = scene_manager_alloc(&infrared_scene_handlers, infrared);
|
||||
infrared->view_dispatcher = view_dispatcher_alloc();
|
||||
|
||||
infrared->gui = furi_record_open("gui");
|
||||
infrared->gui = furi_record_open(RECORD_GUI);
|
||||
|
||||
ViewDispatcher* view_dispatcher = infrared->view_dispatcher;
|
||||
view_dispatcher_enable_queue(view_dispatcher);
|
||||
@@ -149,9 +149,9 @@ static Infrared* infrared_alloc() {
|
||||
view_dispatcher_set_navigation_event_callback(view_dispatcher, infrared_back_event_callback);
|
||||
view_dispatcher_set_tick_event_callback(view_dispatcher, infrared_tick_event_callback, 100);
|
||||
|
||||
infrared->storage = furi_record_open("storage");
|
||||
infrared->dialogs = furi_record_open("dialogs");
|
||||
infrared->notifications = furi_record_open("notification");
|
||||
infrared->storage = furi_record_open(RECORD_STORAGE);
|
||||
infrared->dialogs = furi_record_open(RECORD_DIALOGS);
|
||||
infrared->notifications = furi_record_open(RECORD_NOTIFICATION);
|
||||
|
||||
infrared->worker = infrared_worker_alloc();
|
||||
infrared->remote = infrared_remote_alloc();
|
||||
@@ -242,16 +242,16 @@ static void infrared_free(Infrared* infrared) {
|
||||
infrared_remote_free(infrared->remote);
|
||||
infrared_worker_free(infrared->worker);
|
||||
|
||||
furi_record_close("gui");
|
||||
furi_record_close(RECORD_GUI);
|
||||
infrared->gui = NULL;
|
||||
|
||||
furi_record_close("notification");
|
||||
furi_record_close(RECORD_NOTIFICATION);
|
||||
infrared->notifications = NULL;
|
||||
|
||||
furi_record_close("dialogs");
|
||||
furi_record_close(RECORD_DIALOGS);
|
||||
infrared->dialogs = NULL;
|
||||
|
||||
furi_record_close("gui");
|
||||
furi_record_close(RECORD_GUI);
|
||||
infrared->gui = NULL;
|
||||
|
||||
string_clear(infrared->file_path);
|
||||
@@ -302,7 +302,7 @@ bool infrared_rename_current_remote(Infrared* infrared, const char* name) {
|
||||
}
|
||||
string_cat_printf(new_path, "/%s%s", string_get_cstr(new_name), INFRARED_APP_EXTENSION);
|
||||
|
||||
Storage* storage = furi_record_open("storage");
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
FS_Error status = storage_common_rename(
|
||||
storage, infrared_remote_get_path(remote), string_get_cstr(new_path));
|
||||
@@ -312,7 +312,7 @@ bool infrared_rename_current_remote(Infrared* infrared, const char* name) {
|
||||
string_clear(new_name);
|
||||
string_clear(new_path);
|
||||
|
||||
furi_record_close("storage");
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
return (status == FSE_OK || status == FSE_EXIST);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user