Skip to content
Snippets Groups Projects
Commit 499be182 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

When renaming a file (using F2 key), need to get all metadata before update

... otherwise, we'll erase the file's extended description or auxdata, if it
has any.
parent a398abb2
Branches
Tags
No related merge requests found
Pipeline #6614 passed
...@@ -271,6 +271,19 @@ function find_file(fname, list) ...@@ -271,6 +271,19 @@ function find_file(fname, list)
return -1; return -1;
} }
function get_file_details(dircode, filename)
{
var base = new FileBase(dircode);
if(!base.open()) {
uifc.msg("Unable to open base: " + dircode);
return null;
}
var file = base.get(filename, FileBase.DETAIL.EXTENDED);
base.close();
return file;
}
function list_files(title, list, dircode) function list_files(title, list, dircode)
{ {
const wide_screen = uifc.screen_width >= 100; const wide_screen = uifc.screen_width >= 100;
...@@ -347,6 +360,12 @@ function list_files(title, list, dircode) ...@@ -347,6 +360,12 @@ function list_files(title, list, dircode)
} }
break; break;
case MSK_EDIT: case MSK_EDIT:
list[result] = get_file_details(dircode, file.name);
file = list[result];
if(!file) {
uifc.msg("Error getting file details");
break;
}
var orig_name = file.name; var orig_name = file.name;
if(edit_filename(file)) if(edit_filename(file))
save(file, dircode, orig_name); save(file, dircode, orig_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment