mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-05-01 10:40:47 +00:00
change ?: to if else
This commit is contained in:
parent
47482d1e58
commit
6e01a1d0dc
@ -264,11 +264,16 @@ void FileManagerView::on_rename(NavigationView& nav) {
|
|||||||
|
|
||||||
void FileManagerView::on_refactor(NavigationView& nav) {
|
void FileManagerView::on_refactor(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) {
|
||||||
|
|
||||||
std::string destination_path = current_path.string();
|
std::string destination_path = current_path.string();
|
||||||
if (destination_path.back() != '/')
|
if (destination_path.back() != '/')
|
||||||
destination_path += '/';
|
destination_path += '/';
|
||||||
|
|
||||||
destination_path = get_selected_path().string().back() != '/' ? destination_path + buffer + extension_buffer : destination_path + buffer;
|
if(get_selected_path().string().back() != '/'){
|
||||||
|
destination_path = destination_path + buffer + extension_buffer;
|
||||||
|
}else if(get_selected_path().string().back() == '/'){
|
||||||
|
destination_path = destination_path + buffer;
|
||||||
|
}
|
||||||
|
|
||||||
rename_file(get_selected_path(), destination_path); //rename the selected file
|
rename_file(get_selected_path(), destination_path); //rename the selected file
|
||||||
|
|
||||||
@ -289,9 +294,9 @@ void FileManagerView::on_refactor(NavigationView& nav) {
|
|||||||
|
|
||||||
load_directory_contents(current_path);
|
load_directory_contents(current_path);
|
||||||
refresh_list();
|
refresh_list();
|
||||||
extension_buffer.clear();
|
|
||||||
destination_path.clear();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileManagerView::on_delete() {
|
void FileManagerView::on_delete() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user