www

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

commit a076edc8361ff955311edcb075a15c69b05bca3e
parent 2beb2c514c0ba344a59856bf785728b631730a60
Author: Dan Stillman <dstillman@zotero.org>
Date:   Thu, 29 Dec 2016 15:39:09 -0500

Update some deprecated function calls

Diffstat:
Mchrome/content/zotero/xpcom/sync/syncEngine.js | 6++++--
Mchrome/content/zotero/xpcom/zotero.js | 2+-
Mresource/concurrentCaller.js | 6------
Mtest/tests/syncFullTextEngineTest.js | 9++++++---
4 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/chrome/content/zotero/xpcom/sync/syncEngine.js b/chrome/content/zotero/xpcom/sync/syncEngine.js @@ -274,7 +274,8 @@ Zotero.Sync.Data.Engine.prototype._startDownload = Zotero.Promise.coroutine(func } if (newLibraryVersion) { - yield Zotero.Libraries.setVersion(this.libraryID, newLibraryVersion); + this.library.libraryVersion = newLibraryVersion; + yield this.library.saveTx(); } return localChanges @@ -1513,7 +1514,8 @@ Zotero.Sync.Data.Engine.prototype._fullSync = Zotero.Promise.coroutine(function* break; } - yield Zotero.Libraries.setVersion(this.libraryID, lastLibraryVersion); + this.library.libraryVersion = lastLibraryVersion; + yield this.library.saveTx(); Zotero.debug("Done with full sync for " + this.library.name); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js @@ -1453,7 +1453,7 @@ Services.scriptloader.loadSubScript("resource://zotero/polyfill.js"); caller.setLogger(Zotero.debug); return function () { var args = arguments; - return caller.fcall(function () { + return caller.start(function () { return fn.apply(this, args); }.bind(this)); }; diff --git a/resource/concurrentCaller.js b/resource/concurrentCaller.js @@ -165,12 +165,6 @@ ConcurrentCaller.prototype.runAll = function () { } -ConcurrentCaller.prototype.fcall = function (func) { - this._log("fcall() is deprecated -- use start()"); - return this.start(func); -} - - /** * Wait for all running tasks to complete * diff --git a/test/tests/syncFullTextEngineTest.js b/test/tests/syncFullTextEngineTest.js @@ -239,8 +239,10 @@ describe("Zotero.Sync.Data.FullTextEngine", function () { // https://github.com/cjohansen/Sinon.JS/issues/607 var fixSinonBug = ";charset=utf-8"; - var libraryID = Zotero.Libraries.userLibraryID; - yield Zotero.Libraries.setVersion(libraryID, 5); + var library = Zotero.Libraries.userLibrary; + var libraryID = library.id; + library.libraryVersion = 5; + yield library.saveTx(); ({ engine, client, caller } = yield setup()); @@ -347,7 +349,8 @@ describe("Zotero.Sync.Data.FullTextEngine", function () { // Upload new content // ({ engine, client, caller } = yield setup()); - yield Zotero.Libraries.setVersion(libraryID, libraryVersion); + library.libraryVersion = libraryVersion; + yield library.saveTx(); var attachment3 = new Zotero.Item('attachment'); attachment3.parentItemID = item.id;