From e03867bbf056db3ce4cb89fdd2ca47296b05859e Mon Sep 17 00:00:00 2001 From: Willy-JL <49810075+Willy-JL@users.noreply.github.com> Date: Mon, 15 May 2023 05:39:37 +0100 Subject: [PATCH] OFW, why are you ignoring "already exists" errors? --- applications/main/archive/helpers/archive_files.c | 2 +- applications/main/archive/scenes/archive_scene_rename.c | 5 ++--- applications/main/infrared/infrared.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/applications/main/archive/helpers/archive_files.c b/applications/main/archive/helpers/archive_files.c index 5f5d13fc3..cf78c72ef 100644 --- a/applications/main/archive/helpers/archive_files.c +++ b/applications/main/archive/helpers/archive_files.c @@ -139,7 +139,7 @@ FS_Error archive_rename_file_or_dir(void* context, const char* src_path, const c archive_favorites_rename(src_path, dst_path); } - if(error == FSE_OK || error == FSE_EXIST) { + if(error == FSE_OK) { FURI_LOG_I(TAG, "Rename from %s to %s is DONE", src_path, dst_path); archive_refresh_dir(browser); } else { diff --git a/applications/main/archive/scenes/archive_scene_rename.c b/applications/main/archive/scenes/archive_scene_rename.c index 346383162..869b861b2 100644 --- a/applications/main/archive/scenes/archive_scene_rename.c +++ b/applications/main/archive/scenes/archive_scene_rename.c @@ -92,9 +92,7 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) { furi_string_free(path_dst); - if(error == FSE_OK || error == FSE_EXIST) { - scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); - } else { + if(error != FSE_OK) { FuriString* dialog_msg; dialog_msg = furi_string_alloc(); furi_string_cat_printf(dialog_msg, "Cannot rename\nCode: %d", error); @@ -102,6 +100,7 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) { archive->dialogs, furi_string_get_cstr(dialog_msg)); furi_string_free(dialog_msg); } + scene_manager_next_scene(archive->scene_manager, ArchiveAppSceneBrowser); consumed = true; } } diff --git a/applications/main/infrared/infrared.c b/applications/main/infrared/infrared.c index 0d52cc3bf..838037f11 100644 --- a/applications/main/infrared/infrared.c +++ b/applications/main/infrared/infrared.c @@ -311,7 +311,7 @@ bool infrared_rename_current_remote(Infrared* infrared, const char* name) { furi_string_free(new_path); furi_record_close(RECORD_STORAGE); - return (status == FSE_OK || status == FSE_EXIST); + return status == FSE_OK; } void infrared_tx_start_signal(Infrared* infrared, InfraredSignal* signal) {