Procházet zdrojové kódy

Update nfc_playlist_scene_file_rename.c

acegoal07 před 1 rokem
rodič
revize
94443e763c
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      scenes/nfc_playlist_scene_file_rename.c

+ 7 - 2
scenes/nfc_playlist_scene_file_rename.c

@@ -12,12 +12,17 @@ void nfc_playlist_file_rename_menu_callback(void* context) {
    furi_string_cat_str(new_file_path, ".txt");
    char const* new_file_path_cstr = furi_string_get_cstr(new_file_path);
 
-   if(!storage_file_exists(storage, new_file_path_cstr)) {
-      storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr);
+   if (storage_common_rename_safe(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr) == 0) {
       furi_string_free(nfc_playlist->settings.file_path);
       nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr);
    }
 
+   // if (!storage_file_exists(storage, new_file_path_cstr)) {
+   //    storage_common_rename(storage, furi_string_get_cstr(nfc_playlist->settings.file_path), new_file_path_cstr);
+   //    furi_string_free(nfc_playlist->settings.file_path);
+   //    nfc_playlist->settings.file_path = furi_string_alloc_set_str(new_file_path_cstr);
+   // }
+
    furi_record_close(RECORD_STORAGE);
    furi_string_free(new_file_path);