Fixes a bug when zotero dir exists elsewhere and you want to select a custom one (#1070)
This commit is contained in:
parent
ef9f727adf
commit
715193639b
1 changed files with 10 additions and 1 deletions
|
@ -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);
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue