From 8b13d473c7028c0adc0c5ba08b8f7b130a983090 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Sat, 17 Aug 2013 01:16:58 -0400 Subject: [PATCH] Import OS.File into Zotero global scope --- chrome/content/zotero/xpcom/data/item.js | 1 - chrome/content/zotero/xpcom/storage.js | 2 -- chrome/content/zotero/xpcom/utilities_internal.js | 1 - chrome/content/zotero/xpcom/zotero.js | 1 + 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index 7947af21d5..01196c858b 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -2980,7 +2980,6 @@ Zotero.Item.prototype.fileExistsAsync = function () { } var nsIFile = self.getFile(null, true); - Components.utils.import("resource://gre/modules/osfile.jsm"); return Q(OS.File.exists(nsIFile.path)) .then(function(exists) { self._updateAttachmentStates(exists); diff --git a/chrome/content/zotero/xpcom/storage.js b/chrome/content/zotero/xpcom/storage.js index 2b36a73c68..f56fd959dc 100644 --- a/chrome/content/zotero/xpcom/storage.js +++ b/chrome/content/zotero/xpcom/storage.js @@ -938,8 +938,6 @@ Zotero.Sync.Storage = new function () { throw new Task.Result(changed); } - Components.utils.import("resource://gre/modules/osfile.jsm"); - let checkItems = function () { if (!items.length) return Q(); diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index af9ed28d2a..b363d2dc3b 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -96,7 +96,6 @@ Zotero.Utilities.Internal = { * rather than hex string */ "md5Async": function (file, base64) { - Components.utils.import("resource://gre/modules/osfile.jsm"); const CHUNK_SIZE = 16384; var deferred = Q.defer(); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index aa80c47a52..5c760502ea 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -44,6 +44,7 @@ const ZOTERO_CONFIG = { Components.utils.import("resource://zotero/q.js"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); +Components.utils.import("resource://gre/modules/osfile.jsm"); /* * Core functions