- Update file mod time when renaming so that new names sync

- Display file timestamp in conflict resolution box
This commit is contained in:
Dan Stillman 2009-06-02 08:20:41 +00:00
parent c122764d7f
commit 5b7923c71d
3 changed files with 12 additions and 0 deletions

View file

@ -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:

View file

@ -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()");

View file

@ -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;