mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-11 23:17:39 +00:00
fixes file renaming on subdir
The file rename function needs to be called with full_path/old_name and full_path/new_name. Instead, it was called with full_path/old_name and new_name ... thus the renamed file ended on the root dir (path not preserved).
This commit is contained in:
@@ -249,7 +249,11 @@ FileLoadView::FileLoadView(
|
|||||||
|
|
||||||
void FileManagerView::on_rename(NavigationView& nav) {
|
void FileManagerView::on_rename(NavigationView& nav) {
|
||||||
text_prompt(nav, name_buffer, max_filename_length, [this](std::string& buffer) {
|
text_prompt(nav, name_buffer, max_filename_length, [this](std::string& buffer) {
|
||||||
rename_file(get_selected_path(), buffer);
|
std::string destination_path = current_path.string();
|
||||||
|
if (destination_path.back() != '/')
|
||||||
|
destination_path += '/';
|
||||||
|
destination_path = destination_path + buffer;
|
||||||
|
rename_file(get_selected_path(), destination_path);
|
||||||
load_directory_contents(current_path);
|
load_directory_contents(current_path);
|
||||||
refresh_list();
|
refresh_list();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user