BadUSB and Archive fixes (#2005)

* BsdUsb: fix empty lines handling
* Archive: folders and unknown files rename fix

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-11-12 14:55:42 +03:00
committed by GitHub
parent f9730bcafe
commit 73441af9c6
5 changed files with 11 additions and 12 deletions

View File

@@ -133,7 +133,7 @@ bool archive_scene_browser_on_event(void* context, SceneManagerEvent event) {
case ArchiveBrowserEventFileMenuRename:
if(favorites) {
browser->callback(ArchiveBrowserEventEnterFavMove, browser->context);
} else if((archive_is_known_app(selected->type)) && (selected->is_app == false)) {
} else if(selected->is_app == false) {
archive_show_file_menu(browser, false);
scene_manager_set_scene_state(
archive->scene_manager, ArchiveAppSceneBrowser, SCENE_STATE_NEED_REFRESH);

View File

@@ -57,9 +57,11 @@ bool archive_scene_rename_on_event(void* context, SceneManagerEvent event) {
ArchiveFile_t* file = archive_get_current_file(archive->browser);
FuriString* path_dst;
path_dst = furi_string_alloc();
path_extract_dirname(path_src, path_dst);
furi_string_cat_printf(path_dst, "/%s%s", archive->text_store, known_ext[file->type]);
furi_string_cat_printf(
path_dst, "/%s%s", archive->text_store, archive->file_extension);
storage_common_rename(fs_api, path_src, furi_string_get_cstr(path_dst));
furi_record_close(RECORD_STORAGE);