fx115: PathUtils.normalize() requires files to exist

Unlike OS.Path.normalize()
This commit is contained in:
Dan Stillman 2023-12-07 05:17:50 -05:00
parent 28f4857592
commit dd745ed1aa
2 changed files with 4 additions and 4 deletions

View file

@ -201,7 +201,7 @@ FilePicker.prototype.filterVideo = 0x200;
switch (prop) {
case 'file':
// Convert from nsIFile
val = PathUtils.normalize(val.path);
val = val.path;
break;
case 'files':
@ -209,7 +209,7 @@ FilePicker.prototype.filterVideo = 0x200;
while (val.hasMoreElements()) {
let file = val.getNext();
file.QueryInterface(Ci.nsIFile);
files.push(PathUtils.normalize(file.path));
files.push(file.path);
}
val = files;
break;

View file

@ -565,7 +565,7 @@ Zotero_Preferences.Attachment_Base_Directory = {
if (await fp.show() != fp.returnOK) {
return false;
}
var newPath = fp.file;
var newPath = PathUtils.normalize(fp.file);
if (oldPath && oldPath == newPath) {
Zotero.debug("Base directory hasn't changed");
@ -650,7 +650,7 @@ Zotero_Preferences.Attachment_Base_Directory = {
}
// Existing relative attachments not within the new base directory
// will be converted to absolute paths
else if (relPath && this.getPath()) {
else if (relPath && Zotero.Prefs.get('baseAttachmentPath')) {
Zotero.debug(`Converting ${relPath} to absolute path`);
newAttachmentPaths[attachmentID] = attachmentPath;
numOldAttachments++;