From a1b623b325a2174fb963f3ea621f723c458f8e8b Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 23 Jan 2013 20:21:27 -0500 Subject: [PATCH] We now allow to change the storage format for plists. --- OpenChange/SOGoMAPIDBObject.m | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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];