From ce6a0ecb01790777461ed9a4c69312dc7c1b75ed Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 13 Nov 2016 04:50:00 -0500 Subject: [PATCH] Tell connector to reinit after moving data directory --- chrome/content/zotero/xpcom/ipc.js | 5 +++++ chrome/content/zotero/xpcom/zotero.js | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/chrome/content/zotero/xpcom/ipc.js b/chrome/content/zotero/xpcom/ipc.js index 0912e423cc..699ac3f6dc 100755 --- a/chrome/content/zotero/xpcom/ipc.js +++ b/chrome/content/zotero/xpcom/ipc.js @@ -93,6 +93,11 @@ Zotero.IPC = new function() { // translators Zotero.initComplete(); } + else if (msg == "reinit") { + if (Zotero.isConnector) { + reinit(false, true); + } + } } } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index 4a8eb226f1..15da2fe67a 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -1495,6 +1495,10 @@ Components.utils.import("resource://gre/modules/osfile.jsm"); // Set data directory again Zotero.debug("Using new data directory " + newDir); this._cacheDataDirectory(newDir); + // Tell Zotero for Firefox in connector mode to reload and find the new data directory + if (this.isStandalone) { + Zotero.IPC.broadcast('reinit'); + } // At least the database was copied, but other things failed if (errors.length) {