merge of 'c8d084db03459d614e6031f3b3996696f8a588b4'

and 'e3d03c71b23436eb1ba6f15cfccc6c59a06df891'

Monotone-Parent: c8d084db03459d614e6031f3b3996696f8a588b4
Monotone-Parent: e3d03c71b23436eb1ba6f15cfccc6c59a06df891
Monotone-Revision: b1078ea4dae02277bdf66ea5ad2e7fcdb26dc259

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2008-12-15T22:28:32
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2008-12-15 22:28:32 +00:00
commit 4a43370a91
12 changed files with 65 additions and 98 deletions

View File

@ -1,3 +1,23 @@
2008-12-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Appointments/SOGoAppointmentFolder.m
([SOGoAppointmentFolder +webdavAclManager]): same as below.
* SoObjects/Appointments/SOGoAppointmentObject.m
([SOGoAppointmentObject +webdavAclManager]): same as below.
* SoObjects/SOGo/SOGoFolder.m ([SOGoFolder +webdavAclManager]):
same as below.
* SoObjects/SOGo/SOGoGCSFolder.m ([SOGoGCSFolder
+webdavAclManager]): same as below.
* SoObjects/SOGo/SOGoObject.m ([SOGoObject +webdavAclManager]):
same as below.
* SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder
+webdavAclManager]): declare singleton as static to avoid leaking.
2008-12-15 Ludovic Marcotte <lmarcotte@inverse.ca>
* Updated german translations - patch from

View File

@ -105,17 +105,17 @@
- (void) dealloc
{
if (tag)
[tag release];
[values release];
// [parent release];
[tag release];
[group release];
[attributes release];
[parent release];
[values release];
[super dealloc];
}
- (void) setParent: (CardGroup *) aParent
{
ASSIGN (parent, aParent);
parent = aParent;
}
- (id) parent
@ -128,6 +128,11 @@
ASSIGN (tag, aTag);
}
- (NSString *) tag
{
return tag;
}
- (void) setGroup: (NSString *) aGroup
{
ASSIGN (group, aGroup);
@ -216,11 +221,6 @@
[self addAttribute: @"type" value: aType];
}
- (NSString *) tag
{
return tag;
}
- (NSArray *) values
{
return values;
@ -493,16 +493,12 @@
- (void) setValuesAsCopy: (NSMutableArray *) someValues
{
[values release];
values = someValues;
[values retain];
ASSIGN (values, someValues);
}
- (void) setAttributesAsCopy: (NSMutableDictionary *) someAttributes
{
[attributes release];
attributes = someAttributes;
[attributes retain];
ASSIGN (attributes, someAttributes);
}
- (CardGroup *) searchParentOfClass: (Class) parentClass
@ -537,6 +533,7 @@
{
newChild = [[oldArray objectAtIndex: count] mutableCopyWithZone: aZone];
[newArray addObject: newChild];
[newChild release];
}
return newArray;
@ -565,7 +562,6 @@
new = [[self class] new];
[new setTag: [tag copyWithZone: aZone]];
[new setGroup: [group copyWithZone: aZone]];
[new setParent: nil];
[new setValuesAsCopy: [self deepCopyOfArray: values withZone: aZone]];
[new setAttributesAsCopy: [self deepCopyOfDictionary: attributes
withZone: aZone]];
@ -581,7 +577,6 @@
new = [[self class] new];
[new setTag: [tag mutableCopyWithZone: aZone]];
[new setGroup: [group mutableCopyWithZone: aZone]];
[new setParent: nil];
[new setValuesAsCopy: [self deepCopyOfArray: values withZone: aZone]];
[new setAttributesAsCopy: [self deepCopyOfDictionary: attributes
withZone: aZone]];

View File

@ -68,7 +68,7 @@ static NGCardsSaxHandler *sax = nil;
+ (NSArray *) parseFromSource: (id) source
{
static id <NSObject,SaxXMLReader> cardParser;
static id <NSObject, SaxXMLReader> cardParser;
NSArray *cardGroups;
cardGroups = nil;
@ -83,6 +83,7 @@ static NGCardsSaxHandler *sax = nil;
[parser parseFromSource: source];
cardGroups = [sax cards];
[sax reset];
}
}

View File

@ -1,3 +1,8 @@
2008-12-15 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* CardElement.m ([CardElement -setParent:aParent]): no longer
retain the parent passed as parameter.
2008-12-10 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* iCalYearlyRecurrenceCalculator.m

View File

@ -39,36 +39,23 @@
@interface NGCardsSaxHandler : SaxDefaultHandler
{
unichar *content;
NSMutableArray *cards;
CardElement *currentElement;
CardGroup *currentCardGroup;
NSString *currentGroup;
unichar *content;
unsigned contentLength;
NSMutableDictionary *xtags;
NSMutableDictionary *subvalues;
NSMutableArray *types;
NSMutableDictionary *args;
NSMutableArray *tel;
NSMutableArray *adr;
NSMutableArray *email;
NSMutableArray *label;
NSMutableArray *url;
NSMutableArray *fburl;
NSMutableArray *caluri;
struct {
int isInVCardSet:1;
int isInVCard:1;
int isInN:1;
int isInAdr:1;
int isInOrg:1;
int isInGroup:1;
int isInGeo:1;
int collectContent:1;
int reserved:24;
} vcs;
Class topGroupClass;

View File

@ -49,6 +49,7 @@
{
if (content)
free (content);
[self reset];
[cards release];
[currentGroup release];
[super dealloc];
@ -71,7 +72,9 @@
content = NULL;
}
vcs.isInVCardSet = 0;
vcs.isInVCardSet = 0;
vcs.isInVCard = 0;
vcs.isInGroup = 0;
vcs.collectContent = 0;
}
@ -86,7 +89,7 @@
- (void) startDocument
{
if (!cards)
cards = [[NSMutableArray alloc] initWithCapacity:16];
cards = [[NSMutableArray alloc] initWithCapacity: 16];
[self reset];
}
@ -95,56 +98,12 @@
[self resetExceptResult];
}
/* common tags */
- (void) startValueTag: (NSString *) _tag
attributes: (id<SaxAttributes>) _attrs
{
/* a tag with types and attributes */
unsigned i, count;
[types removeAllObjects];
[args removeAllObjects];
for (i = 0, count = [_attrs count]; i < count; i++) {
NSString *n, *v;
n = [_attrs nameAtIndex:i];
v = [_attrs valueAtIndex:i];
if ([n hasSuffix:@".type"] || [n isEqualToString:@"TYPE"]) {
/*
Note: types cannot be separated by comma! Its indeed always a space,eg
"work pref voice"
If you find commas, usually the vCard is broken.
*/
NSEnumerator *e;
NSString *k;
e = [[v componentsSeparatedByString:@" "] objectEnumerator];
while ((k = [e nextObject]) != nil) {
k = [k uppercaseString];
if ([types containsObject:k]) continue;
[types addObject:k];
}
}
else
[args setObject:v forKey:n];
}
}
- (void) endValueTag
{
[types removeAllObjects];
[args removeAllObjects];
}
/* handle elements */
- (void) startGroup: (NSString *)_name
{
vcs.isInGroup = 1;
ASSIGNCOPY(currentGroup, _name);
ASSIGNCOPY (currentGroup, _name);
}
- (void) endGroup
@ -229,10 +188,12 @@
- (void) startCollectingContent
{
if (content) {
free (content);
content = NULL;
}
if (content)
{
free (content);
content = NULL;
}
vcs.collectContent = 1;
}

View File

@ -127,7 +127,7 @@ static Class sogoAppointmentFolderKlass = Nil;
+ (SOGoWebDAVAclManager *) webdavAclManager
{
SOGoWebDAVAclManager *aclManager = nil;
static SOGoWebDAVAclManager *aclManager = nil;
NSString *nsI;
if (!aclManager)
@ -1071,7 +1071,6 @@ static Class sogoAppointmentFolderKlass = Nil;
NSString **values, **currentValue;
SoSecurityManager *mgr;
SEL methodSel;
Class c;
#warning things may crash here...
values = calloc (100, sizeof (NSMutableString *));

View File

@ -58,7 +58,7 @@
+ (SOGoWebDAVAclManager *) webdavAclManager
{
SOGoWebDAVAclManager *aclManager = nil;
static SOGoWebDAVAclManager *aclManager = nil;
NSString *nsD, *nsI;
if (!aclManager)

View File

@ -58,12 +58,14 @@ static NSLock *lock;
@implementation SOGoCache
#if defined(THREADSAFE)
+ (void) initialize
{
#if defined(THREADSAFE)
lock = [NSLock new];
}
#endif
s_userDefaults = [[NSMutableDictionary alloc] init];
s_userSettings = [[NSMutableDictionary alloc] init];
}
+ (NSTimeInterval) cleanupInterval
{
@ -105,9 +107,6 @@ static NSLock *lock;
cache = [[NSMutableDictionary alloc] init];
users = [[NSMutableDictionary alloc] init];
s_userDefaults = [[NSMutableDictionary alloc] init];
s_userSettings = [[NSMutableDictionary alloc] init];
// We register ourself for notifications
[[NSDistributedNotificationCenter defaultCenter]
addObserver: self

View File

@ -46,7 +46,7 @@
+ (SOGoWebDAVAclManager *) webdavAclManager
{
SOGoWebDAVAclManager *webdavAclManager = nil;
static SOGoWebDAVAclManager *webdavAclManager = nil;
if (!webdavAclManager)
{

View File

@ -73,7 +73,7 @@ static NSArray *childRecordFields = nil;
+ (SOGoWebDAVAclManager *) webdavAclManager
{
SOGoWebDAVAclManager *aclManager = nil;
static SOGoWebDAVAclManager *aclManager = nil;
if (!aclManager)
{

View File

@ -54,7 +54,7 @@ static SoSecurityManager *sm = nil;
+ (SOGoWebDAVAclManager *) webdavAclManager
{
SOGoWebDAVAclManager *aclManager = nil;
static SOGoWebDAVAclManager *aclManager = nil;
if (!aclManager)
{