mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-06-23 06:14:13 -04: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
1 changed files with 5 additions and 1 deletions
|
@ -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();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue