bug 327930 - when using getItems() LAST-MODIFIED property should actually represent the last mtime. Patch by Norbert Püschel <norbert.pueschel@networker-gmbh.de>, r1=ctalbert, r2=mvl

git-svn-id: svn://10.0.0.236/trunk@221847 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
mattwillis%gmail.com
2007-03-13 23:38:27 +00:00
parent b624f32c2b
commit 0b1415cb04
2 changed files with 28 additions and 10 deletions

View File

@@ -378,7 +378,11 @@ calItemBase.prototype = {
},
setProperty: function (aName, aValue) {
this.modify();
if (aName == "LAST-MODIFIED") {
this.mDirty = false;
} else {
this.modify();
}
this.mProperties.setProperty(aName.toUpperCase(), aValue);
},

View File

@@ -1484,10 +1484,6 @@ calStorageCalendar.prototype = {
// read in the common ItemBase attributes from aDBRow, and stick
// them on item
getItemBaseFromRow: function (row, flags, item) {
if (row.time_created)
item.creationDate = newDateTime(row.time_created, "UTC");
if (row.last_modified)
item.lastModifiedTime = newDateTime(row.last_modified, "UTC");
item.calendar = this;
item.id = row.id;
if (row.title)
@@ -1548,32 +1544,41 @@ calStorageCalendar.prototype = {
if (flags)
flags.value = row.flags;
if (row.time_created) {
item.setProperty("CREATED", newDateTime(row.time_created, "UTC"));
}
// This must be done last because the setting of any other property
// after this would overwrite it again.
if (row.last_modified) {
item.setProperty("LAST-MODIFIED", newDateTime(row.last_modified, "UTC"));
}
},
getEventFromRow: function (row, flags) {
var item = createEvent();
this.getItemBaseFromRow (row, flags, item);
if (row.event_start)
item.startDate = newDateTime(row.event_start, row.event_start_tz);
if (row.event_end)
item.endDate = newDateTime(row.event_end, row.event_end_tz);
if (row.event_stamp)
item.stampTime = newDateTime(row.event_stamp, "UTC");
item.setProperty("DTSTAMP", newDateTime(row.event_stamp, "UTC"));
if ((row.flags & CAL_ITEM_FLAG_EVENT_ALLDAY) != 0) {
item.startDate.isDate = true;
item.endDate.isDate = true;
}
// This must be done last to keep the modification time intact.
this.getItemBaseFromRow (row, flags, item);
return item;
},
getTodoFromRow: function (row, flags) {
var item = createTodo();
this.getItemBaseFromRow (row, flags, item);
if (row.todo_entry)
item.entryDate = newDateTime(row.todo_entry, row.todo_entry_tz);
if (row.todo_due)
@@ -1583,6 +1588,9 @@ calStorageCalendar.prototype = {
if (row.todo_complete)
item.percentComplete = row.todo_complete;
// This must be done last to keep the modification time intact.
this.getItemBaseFromRow (row, flags, item);
return item;
},
@@ -1594,6 +1602,9 @@ calStorageCalendar.prototype = {
// against mDBTwo in here!
getAdditionalDataForItem: function (item, flags) {
// This is needed to keep the modification time intact.
var savedLastModifiedTime = item.lastModifiedTime;
if (flags & CAL_ITEM_FLAG_HAS_ATTENDEES) {
var selectItem = null;
if (item.recurrenceId == null)
@@ -1750,6 +1761,9 @@ calStorageCalendar.prototype = {
rec.modifyException(exc.item);
}
}
// Restore the saved modification time
item.setProperty("LAST-MODIFIED", savedLastModifiedTime);
},
getAttendeeFromRow: function (row) {