mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-25 22:16:14 -05: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:
parent
41cecc88a1
commit
bb264dcf57
@ -249,7 +249,11 @@ FileLoadView::FileLoadView(
|
||||
|
||||
void FileManagerView::on_rename(NavigationView& nav) {
|
||||
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);
|
||||
refresh_list();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user