fx128: nsIOSFileConstantsService is gone

This commit is contained in:
Dan Stillman 2024-06-09 22:54:34 -04:00
parent 3fde2a3e43
commit 7f619e3fe3
3 changed files with 6 additions and 12 deletions

View file

@ -322,9 +322,6 @@ var Zotero_File_Interface = new function() {
this.getMendeleyDirectory = function () {
Components.classes["@mozilla.org/net/osfileconstantsservice;1"]
.getService(Components.interfaces.nsIOSFileConstantsService)
.init();
var path = FileUtils.getDir('Home', []).path;
if (Zotero.isMac) {
path = PathUtils.join(path, ['Library', 'Application Support', 'Mendeley Desktop']);

View file

@ -356,9 +356,12 @@ Zotero.DataDirectory = {
yield Zotero.File.createDirectoryIfMissingAsync(dataDir);
}
catch (e) {
// TEMP: OS.Constants.Win.ERROR_ACCESS_DENIED no longer available, but we should
// switch to IOUtils anyway
const WIN_ERROR_ACCESS_DENIED = 5;
if (e instanceof OS.File.Error
&& (('unixErrno' in e && e.unixErrno == OS.Constants.libc.EACCES)
|| ('winLastError' in e && e.winLastError == OS.Constants.Win.ERROR_ACCESS_DENIED))) {
&& (('unixErrno' in e && e.unixErrno == ChromeUtils.getLibcConstants().EACCES)
|| ('winLastError' in e && e.winLastError == WIN_ERROR_ACCESS_DENIED))) {
Zotero.restarting = true;
let isDefaultDir = dataDir == Zotero.DataDirectory.defaultDir;
let ps = Services.prompt;
@ -675,11 +678,8 @@ Zotero.DataDirectory = {
} catch(e) {
yield OS.File.remove(tmpFile);
Components.classes["@mozilla.org/net/osfileconstantsservice;1"].
getService(Components.interfaces.nsIOSFileConstantsService).
init();
if (e instanceof OS.File.Error) {
if (e.unixErrno != undefined && e.unixErrno == OS.Constants.libc.EXDEV) {
if (e.unixErrno != undefined && e.unixErrno == ChromeUtils.getLibcConstants().EXDEV) {
return true;
}
// ERROR_NOT_SAME_DEVICE is undefined

View file

@ -28,9 +28,6 @@ Components.utils.importGlobalProperties(["XMLHttpRequest"]);
Components.utils.import("resource://zotero/config.js");
Components.utils.import("resource://gre/modules/Services.jsm");
var { OS } = ChromeUtils.importESModule("chrome://zotero/content/osfile.mjs");
Components.classes["@mozilla.org/net/osfileconstantsservice;1"]
.getService(Components.interfaces.nsIOSFileConstantsService)
.init();
const { XPCOMUtils } = ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetters(globalThis, {