commit 5b7923c71d7bb93784ce653a59c8da72f0de6e05
parent c122764d7f61e4d2dc719fcf206fa4f66f502809
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 2 Jun 2009 08:20:41 +0000
- Update file mod time when renaming so that new names sync
- Display file timestamp in conflict resolution box
Diffstat:
3 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/bindings/attachmentbox.xml b/chrome/content/zotero/bindings/attachmentbox.xml
@@ -51,6 +51,8 @@
<property name="mode" onget="return this._mode;">
<setter>
<![CDATA[
+ Zotero.debug("Setting mode to '" + val + "'");
+
this.editable = false;
this.displayGoButtons = false;
this.displayURL = false;
@@ -72,6 +74,7 @@
this.displayPages = true;
this.displayIndexed = true;
this.displayNote = true;
+ this.displayDateModified = true;
break;
case 'edit':
@@ -84,6 +87,7 @@
this.displayPages = true;
this.displayIndexed = true;
this.displayNote = true;
+ this.displayDateModified = true;
break;
case 'merge':
@@ -92,13 +96,16 @@
this.displayAccessed = true;
this.displayNote = true;
this.displayButton = true;
+ this.displayDateModified = true;
break;
case 'mergeedit':
+ this.editable = true;
this.displayURL = true;
this.displayFileName = true;
this.displayAccessed = true;
this.displayNote = true;
+ this.displayDateModified = true;
break;
default:
diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js
@@ -965,6 +965,9 @@ Zotero.Attachments = new function(){
function getStorageDirectory(itemID) {
+ if (!itemID) {
+ throw ("itemID not provided in Zotero.Attachments.getStorageDirectory()");
+ }
var item = Zotero.Items.get(itemID);
if (!item) {
throw ("Item " + itemID + " not found in Zotero.Attachments.getStorageDirectory()");
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -2531,6 +2531,8 @@ Zotero.Item.prototype.renameAttachmentFile = function(newName, overwrite) {
}
file.moveTo(null, newName);
+ // Update mod time so the file syncs
+ file.lastModifiedTime = new Date();
this.relinkAttachmentFile(file);
return true;