diff --git a/OpenChange/SOGoMAPIDBObject.m b/OpenChange/SOGoMAPIDBObject.m index 0b75270af..7f24c8dd6 100644 --- a/OpenChange/SOGoMAPIDBObject.m +++ b/OpenChange/SOGoMAPIDBObject.m @@ -28,6 +28,7 @@ #import #import #import +#import #import #import #import @@ -48,6 +49,18 @@ #import "SOGoMAPIDBObject.h" +// +// This defines the storage for internal properly list, stored in the +// database. Possible values are: +// +// NSPropertyListGNUstepFormat = 1000 +// NSPropertyListGNUstepBinaryFormat = 1001 +// NSPropertyListOpenStepFormat = 1 +// NSPropertyListXMLFormat_v1_0 = 100 +// NSPropertyListBinaryFormat_v1_0 = 200 +// +static NSPropertyListFormat plistFormat; + static EOAttribute *textColumn = nil; @implementation SOGoMAPIDBObject @@ -56,6 +69,11 @@ static EOAttribute *textColumn = nil; { NSDictionary *description; + plistFormat = [[NSUserDefaults standardUserDefaults] integerForKey: @"SOGoPropertyListFormat"]; + + if (!plistFormat) + plistFormat = NSPropertyListGNUstepBinaryFormat; + if (!textColumn) { /* TODO: this is a hack for providing an EOAttribute definition that is @@ -510,7 +528,7 @@ static EOAttribute *textColumn = nil; { content = [NSPropertyListSerialization dataFromPropertyList: properties - format: NSPropertyListGNUstepBinaryFormat + format: plistFormat errorDescription: NULL]; propsValue = [adaptor formatValue: [content stringByEncodingBase64] forAttribute: textColumn];