From 50934eef0c0b4275677ee75fa9223d0e1d756d51 Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Mon, 20 Sep 2010 02:50:24 +0000 Subject: [PATCH] support importing on Windows and *NIX --- chrome/content/zotero/xpcom/zotero.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 9775e0a94..b0e11e1d1 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -618,11 +618,30 @@ 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()) { + if(Zotero.isStandalone) { + if(Zotero.isWin) { + var path = "../Mozilla/Firefox"; + } else if(Zotero.isMac) { + var path = "../Firefox"; + } else { + var path = "../.mozilla/firefox"; + } + } else { + if(Zotero.isWin) { + var path = "../../Zotero"; + } else if(Zotero.isMac) { + var path = "../Zotero"; + } else { + var path = "../../.zotero"; + } + } + // get Firefox directory var prefDir = Components.classes["@mozilla.org/file/directory_service;1"] .getService(Components.interfaces.nsIProperties) - .get("DefProfRt", Components.interfaces.nsILocalFile).parent.parent; - prefDir.append(Zotero.isStandalone ? "Firefox" : "Zotero"); + .get("DefProfRt", Components.interfaces.nsILocalFile).parent + .QueryInterface(Components.interfaces.nsILocalFile); + prefDir.appendRelativePath(path); // get default profile var defProfile = getDefaultProfile(prefDir);