www

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

commit 48680fbfd87a472322ec97f7e96cdcaf546a0e17
parent 572ff64eb1174cbf8df1acb7aaec732ea8d2fc50
Author: Simon Kornblith <simon@simonster.com>
Date:   Sat, 25 Sep 2010 16:00:31 +0000

fix issues searching for existing zotero data directory on windows


Diffstat:
Mchrome/content/zotero/xpcom/zotero.js | 27+++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -618,30 +618,33 @@ var Zotero = new function(){ // if standalone and no directory yet, check Firefox directory // or if in Firefox and no directory yet, check standalone Zotero directory if(!file.exists()) { + var prefDir = Components.classes["@mozilla.org/file/directory_service;1"] + .getService(Components.interfaces.nsIProperties) + .get("DefProfRt", Components.interfaces.nsILocalFile).parent.parent; + if(Zotero.isStandalone) { if(Zotero.isWin) { - var path = "../Mozilla/Firefox"; + prefDir.append("Mozilla"); + prefDir.append("Firefox"); } else if(Zotero.isMac) { - var path = "../Firefox"; + prefDir.append("Firefox"); } else { - var path = "../.mozilla/firefox"; + prefDir.append(".mozilla"); + prefDir.append("firefox"); } } else { if(Zotero.isWin) { - var path = "../../Zotero"; + prefDir = prefDir.parent; + prefDir.append("Zotero"); } else if(Zotero.isMac) { - var path = "../Zotero"; + prefDir.append("Zotero"); } else { - var path = "../../.zotero"; + prefDir = prefDir.parent; + prefDir.append(".zotero"); } } - // get Firefox directory - var prefDir = Components.classes["@mozilla.org/file/directory_service;1"] - .getService(Components.interfaces.nsIProperties) - .get("DefProfRt", Components.interfaces.nsILocalFile).parent - .QueryInterface(Components.interfaces.nsILocalFile); - prefDir.appendRelativePath(path); + Zotero.debug("Looking for existing profile in "+prefDir.path); // get default profile var defProfile = getDefaultProfile(prefDir);