From 5e87a52c61615e6c29ca682db8b9cfa788f452e8 Mon Sep 17 00:00:00 2001 From: "mvl%exedo.nl" Date: Fri, 31 Dec 2004 15:36:10 +0000 Subject: [PATCH] don't update lastmodified when setting icalComponent, when cloning or when setting parent bug 276522, r=shaver git-svn-id: svn://10.0.0.236/trunk@167140 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/calendar/base/src/calEvent.js | 2 ++ mozilla/calendar/base/src/calItemBase.js | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/mozilla/calendar/base/src/calEvent.js b/mozilla/calendar/base/src/calEvent.js index fe9f3a13aa2..ba170329b83 100644 --- a/mozilla/calendar/base/src/calEvent.js +++ b/mozilla/calendar/base/src/calEvent.js @@ -156,6 +156,8 @@ calEvent.prototype = { __proto__: this.itemBasePromotedProps }; this.importUnpromotedProperties(event, promotedProps); + // Importing didn't really change anything + this.mDirty = false; } }; diff --git a/mozilla/calendar/base/src/calItemBase.js b/mozilla/calendar/base/src/calItemBase.js index 3441202c104..eb77d971988 100644 --- a/mozilla/calendar/base/src/calItemBase.js +++ b/mozilla/calendar/base/src/calItemBase.js @@ -108,6 +108,9 @@ calItemBase.prototype = { // for subclasses to use; copies the ItemBase's values // into m cloneItemBaseInto: function (m) { + var suppressDCE = this.lastModifiedTime; + suppressDCE = this.stampTime; + m.mImmutable = false; m.mGeneration = this.mGeneration; m.mLastModifiedTime = this.mLastModifiedTime.clone(); @@ -144,6 +147,8 @@ calItemBase.prototype = { m.mProperties.setProperty (prop.name, prop.value); } + m.mDirty = this.mDirty; + return m; }, @@ -227,6 +232,17 @@ calItemBase.prototype = { this.mAttendees.push(attendee); }, + get parent () { + return this.mParent; + }, + + set parent (v) { + if (this.mImmutable) + // Components.results.NS_ERROR_CALENDAR_IMMUTABLE; + throw Components.results.NS_ERROR_FAILURE; + this.mParent = v; + }, + /* MEMBER_ATTR(mIcalString, "", icalString), */ get icalString() { throw Components.results.NS_NOT_IMPLEMENTED; @@ -239,7 +255,7 @@ calItemBase.prototype = { itemBasePromotedProps: { "CREATED": true, "UID": true, - "LASTMODIFIED": true, + "LAST-MODIFIED": true, "SUMMARY": true, "PRIORITY": true, "METHOD": true, @@ -379,7 +395,6 @@ calItemOccurrence.prototype = { makeMemberAttr(calItemBase, "mGeneration", 0, "generation"); makeMemberAttr(calItemBase, "mCreationDate", null, "creationDate"); -makeMemberAttr(calItemBase, "mParent", null, "parent"); makeMemberAttr(calItemBase, "mId", null, "id"); makeMemberAttr(calItemBase, "mTitle", null, "title"); makeMemberAttr(calItemBase, "mPriority", 0, "priority");