commit e7710660efb36c7ccfa58975d806b98f94fcd456 parent 7091431c21d53f5143baabc7e9c1470ef9256ce4 Author: Dan Stillman <dstillman@zotero.org> Date: Thu, 20 Mar 2014 16:26:06 -0400 Don't change attachment item mod time when downloading unchanged data From attachmentCharset change Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 15 | ++++++++++++--- |
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -3241,7 +3241,7 @@ Zotero.Item.prototype.__defineGetter__('attachmentCharset', function () { return undefined; } - if (this._attachmentCharset != undefined) { + if (this._attachmentCharset !== undefined) { return Zotero.CharacterSets.getName(this._attachmentCharset); } @@ -3264,13 +3264,22 @@ Zotero.Item.prototype.__defineSetter__('attachmentCharset', function (val) { throw (".attachmentCharset can only be set for attachment items"); } - val = Zotero.CharacterSets.getID(val); + var oldVal = this.attachmentCharset; + if (oldVal) { + oldVal = Zotero.CharacterSets.getID(oldVal); + } + if (!oldVal) { + oldVal = null; + } + if (val) { + val = Zotero.CharacterSets.getID(val); + } if (!val) { val = null; } - if (val == this.attachmentCharset) { + if (val == oldVal) { return; }