www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 715193639b2a47c239d4101f9aa527f0f70d9bd4
parent ef9f727adf9817708c337883bbd938ce11b3dc3c
Author: Adomas Ven <adomas.ven@gmail.com>
Date:   Tue,  9 Aug 2016 16:59:10 +0100

Fixes a bug when zotero dir exists elsewhere and you want to select a custom one (#1070)


Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 11++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -1116,7 +1116,16 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); var fp = Components.classes["@mozilla.org/filepicker;1"] .createInstance(nsIFilePicker); fp.init(win, Zotero.getString('dataDir.selectDir'), nsIFilePicker.modeGetFolder); - fp.displayDirectory = Zotero.getZoteroDirectory(); + try { + fp.displayDirectory = Zotero.getZoteroDirectory(); + } catch (e) { + if(e.name == "ZOTERO_DIR_MAY_EXIST") { + fp.displayDirectory = e.dir; + } + else { + throw e; + } + } fp.appendFilters(nsIFilePicker.filterAll); if (fp.show() == nsIFilePicker.returnOK) { var file = fp.file;