[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:
@@ -36,7 +36,7 @@ static void archive_loader_callback(const void* message, void* context) {
|
||||
|
||||
static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selected) {
|
||||
UNUSED(browser);
|
||||
Loader* loader = furi_record_open("loader");
|
||||
Loader* loader = furi_record_open(RECORD_LOADER);
|
||||
|
||||
LoaderStatus status;
|
||||
if(selected->is_app) {
|
||||
@@ -54,7 +54,7 @@ static void archive_run_in_app(ArchiveBrowserView* browser, ArchiveFile_t* selec
|
||||
FURI_LOG_E(TAG, "loader_start failed: %d", status);
|
||||
}
|
||||
|
||||
furi_record_close("loader");
|
||||
furi_record_close(RECORD_LOADER);
|
||||
}
|
||||
|
||||
void archive_scene_browser_callback(ArchiveBrowserEvent event, void* context) {
|
||||
@@ -71,10 +71,10 @@ void archive_scene_browser_on_enter(void* context) {
|
||||
archive_update_focus(browser, archive->text_store);
|
||||
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewBrowser);
|
||||
|
||||
Loader* loader = furi_record_open("loader");
|
||||
Loader* loader = furi_record_open(RECORD_LOADER);
|
||||
archive->loader_stop_subscription =
|
||||
furi_pubsub_subscribe(loader_get_pubsub(loader), archive_loader_callback, archive);
|
||||
furi_record_close("loader");
|
||||
furi_record_close(RECORD_LOADER);
|
||||
|
||||
uint32_t state = scene_manager_get_scene_state(archive->scene_manager, ArchiveAppSceneBrowser);
|
||||
|
||||
@@ -196,10 +196,10 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
|
||||
if(!archive_is_home(browser)) {
|
||||
archive_leave_dir(browser);
|
||||
} else {
|
||||
Loader* loader = furi_record_open("loader");
|
||||
Loader* loader = furi_record_open(RECORD_LOADER);
|
||||
furi_pubsub_unsubscribe(
|
||||
loader_get_pubsub(loader), archive->loader_stop_subscription);
|
||||
furi_record_close("loader");
|
||||
furi_record_close(RECORD_LOADER);
|
||||
|
||||
view_dispatcher_stop(archive->view_dispatcher);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
|
||||
void archive_scene_browser_on_exit(void* context) {
|
||||
ArchiveApp* archive = (ArchiveApp*)context;
|
||||
|
||||
Loader* loader = furi_record_open("loader");
|
||||
Loader* loader = furi_record_open(RECORD_LOADER);
|
||||
furi_pubsub_unsubscribe(loader_get_pubsub(loader), archive->loader_stop_subscription);
|
||||
furi_record_close("loader");
|
||||
furi_record_close(RECORD_LOADER);
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) {
|
||||
|
||||
if(event.type == SceneManagerEventTypeCustom) {
|
||||
if(event.event == SCENE_RENAME_CUSTOM_EVENT) {
|
||||
Storage* fs_api = furi_record_open("storage");
|
||||
Storage* fs_api = furi_record_open(RECORD_STORAGE);
|
||||
|
||||
const char* path_src = archive_get_name(archive->browser);
|
||||
ArchiveFile_t* file = archive_get_current_file(archive->browser);
|
||||
@@ -62,7 +62,7 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) {
|
||||
string_cat_printf(path_dst, "/%s%s", archive->text_store, known_ext[file->type]);
|
||||
|
||||
storage_common_rename(fs_api, path_src, string_get_cstr(path_dst));
|
||||
furi_record_close("storage");
|
||||
furi_record_close(RECORD_STORAGE);
|
||||
|
||||
if(file->fav) {
|
||||
archive_favorites_rename(path_src, string_get_cstr(path_dst));
|
||||
|
Reference in New Issue
Block a user