From a127fc11fc7d6de5f51e822b6f51f0f5ec085f64 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 26 Nov 2008 01:58:33 +0000 Subject: [PATCH] Monotone-Parent: ef1202eb23562c04fbe5f3e3ce4cab4319fe9b98 Monotone-Revision: 8c84d6a640b03db846372423022159e6855f501a Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-11-26T01:58:33 Monotone-Branch: ca.inverse.sogo --- .../Appointments/SOGoAppointmentFolder.m | 4 +--- SoObjects/SOGo/SOGoContentObject.m | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/SoObjects/Appointments/SOGoAppointmentFolder.m b/SoObjects/Appointments/SOGoAppointmentFolder.m index e0620b845..819b6114a 100644 --- a/SoObjects/Appointments/SOGoAppointmentFolder.m +++ b/SoObjects/Appointments/SOGoAppointmentFolder.m @@ -1470,15 +1470,13 @@ static Class sogoAppointmentFolderKlass = Nil; // has only asked for {DAV:}getetag with no other properties, // we do not load the c_content and other fields from the // database as this can be pretty costly. -#if 0 - // FOR AN UNKNOWN REASON FOR NOW, THIS GENERATES EMPTY ETAGS (ALL HAVE GCS0000000 VALUE) +#warning we should build the list of fields based on the requested props if ([*properties caseInsensitiveCompare: @"{DAV:}getetag"] == NSOrderedSame && !*(properties+1)) fields = [NSArray arrayWithObjects: @"c_name", @"c_creationdate", @"c_lastmodified", @"c_version", @"c_component", nil]; else -#endif fields = reportQueryFields; filterList = [filters objectEnumerator]; diff --git a/SoObjects/SOGo/SOGoContentObject.m b/SoObjects/SOGo/SOGoContentObject.m index c014c41a5..28ba25a9c 100644 --- a/SoObjects/SOGo/SOGoContentObject.m +++ b/SoObjects/SOGo/SOGoContentObject.m @@ -86,17 +86,25 @@ - (void) _setRecord: (NSDictionary *) objectRecord { - NSString *newContent; + id data; int intValue; - newContent = [objectRecord objectForKey: @"c_content"]; - if (newContent) + data = [objectRecord objectForKey: @"c_content"]; + if (data) + ASSIGN (content, data); + data = [objectRecord objectForKey: @"c_version"]; + if (data) + version = [data unsignedIntValue]; + data = [objectRecord objectForKey: @"c_creationdate"]; + if (data) { - ASSIGN (content, newContent); - version = [[objectRecord objectForKey: @"c_version"] unsignedIntValue]; - intValue = [[objectRecord objectForKey: @"c_creationdate"] intValue]; + intValue = [data intValue]; ASSIGN (creationDate, [NSCalendarDate dateWithTimeIntervalSince1970: intValue]); + } + data = [objectRecord objectForKey: @"c_lastmodified"]; + if (data) + { intValue = [[objectRecord objectForKey: @"c_lastmodified"] intValue]; ASSIGN (lastModified, [NSCalendarDate dateWithTimeIntervalSince1970: intValue]);