We now allow to change the storage format for plists.
parent
0965fd837a
commit
a1b623b325
|
@ -28,6 +28,7 @@
|
||||||
#import <Foundation/NSPropertyList.h>
|
#import <Foundation/NSPropertyList.h>
|
||||||
#import <Foundation/NSString.h>
|
#import <Foundation/NSString.h>
|
||||||
#import <Foundation/NSURL.h>
|
#import <Foundation/NSURL.h>
|
||||||
|
#import <Foundation/NSUserDefaults.h>
|
||||||
#import <Foundation/NSValue.h>
|
#import <Foundation/NSValue.h>
|
||||||
#import <GDLAccess/EOAdaptor.h>
|
#import <GDLAccess/EOAdaptor.h>
|
||||||
#import <GDLAccess/EOAdaptorChannel.h>
|
#import <GDLAccess/EOAdaptorChannel.h>
|
||||||
|
@ -48,6 +49,18 @@
|
||||||
|
|
||||||
#import "SOGoMAPIDBObject.h"
|
#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;
|
static EOAttribute *textColumn = nil;
|
||||||
|
|
||||||
@implementation SOGoMAPIDBObject
|
@implementation SOGoMAPIDBObject
|
||||||
|
@ -56,6 +69,11 @@ static EOAttribute *textColumn = nil;
|
||||||
{
|
{
|
||||||
NSDictionary *description;
|
NSDictionary *description;
|
||||||
|
|
||||||
|
plistFormat = [[NSUserDefaults standardUserDefaults] integerForKey: @"SOGoPropertyListFormat"];
|
||||||
|
|
||||||
|
if (!plistFormat)
|
||||||
|
plistFormat = NSPropertyListGNUstepBinaryFormat;
|
||||||
|
|
||||||
if (!textColumn)
|
if (!textColumn)
|
||||||
{
|
{
|
||||||
/* TODO: this is a hack for providing an EOAttribute definition that is
|
/* TODO: this is a hack for providing an EOAttribute definition that is
|
||||||
|
@ -510,7 +528,7 @@ static EOAttribute *textColumn = nil;
|
||||||
{
|
{
|
||||||
content = [NSPropertyListSerialization
|
content = [NSPropertyListSerialization
|
||||||
dataFromPropertyList: properties
|
dataFromPropertyList: properties
|
||||||
format: NSPropertyListGNUstepBinaryFormat
|
format: plistFormat
|
||||||
errorDescription: NULL];
|
errorDescription: NULL];
|
||||||
propsValue = [adaptor formatValue: [content stringByEncodingBase64]
|
propsValue = [adaptor formatValue: [content stringByEncodingBase64]
|
||||||
forAttribute: textColumn];
|
forAttribute: textColumn];
|
||||||
|
|
Loading…
Reference in New Issue