From 7f619e3fe3044ea968a9bd0fb31d98f45d5cb75b Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 9 Jun 2024 22:54:34 -0400 Subject: [PATCH] fx128: nsIOSFileConstantsService is gone --- chrome/content/zotero/fileInterface.js | 3 --- chrome/content/zotero/xpcom/dataDirectory.js | 12 ++++++------ chrome/content/zotero/xpcom/zotero.js | 3 --- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/chrome/content/zotero/fileInterface.js b/chrome/content/zotero/fileInterface.js index e9fc9cd46a..8496b0951c 100644 --- a/chrome/content/zotero/fileInterface.js +++ b/chrome/content/zotero/fileInterface.js @@ -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']); diff --git a/chrome/content/zotero/xpcom/dataDirectory.js b/chrome/content/zotero/xpcom/dataDirectory.js index 47b7bdb0ec..726df9fdb4 100644 --- a/chrome/content/zotero/xpcom/dataDirectory.js +++ b/chrome/content/zotero/xpcom/dataDirectory.js @@ -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 diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index ec57ef957d..d591359c03 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -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, {