merge of '106be109a8235ab909bab6ec1c0cc13000074eac'

and 'b2d46c6b2a5ef48f18ce5b5dae9339ace2025d0d'

Monotone-Parent: 106be109a8235ab909bab6ec1c0cc13000074eac
Monotone-Parent: b2d46c6b2a5ef48f18ce5b5dae9339ace2025d0d
Monotone-Revision: 508bbe52515b0ad7119c755b4cc91d17e313c06b

Monotone-Author: flachapelle@inverse.ca
Monotone-Date: 2009-11-04T20:52:35
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Francis Lachapelle
2009-11-04 20:52:35 +00:00
4 changed files with 18 additions and 21 deletions

View File

@@ -1,3 +1,11 @@
2009-11-04 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/SOGo/NSDictionary+Utilities.m
(+dictionaryFromStringsFile:): instantiate autoreleased objects.
* SoObjects/SOGo/NSArray+Utilities.m (-jsonRepresentation):
instantiate autoreleased objects.
2009-10-30 Francis Lachapelle <flachapelle@inverse.ca>
* UI/WebServerResources/SchedulerUI.js: the events list is now

View File

@@ -174,18 +174,12 @@
NSEnumerator *elements;
NSString *representation;
jsonElements = [NSMutableArray new];
jsonElements = [NSMutableArray array];
elements = [self objectEnumerator];
currentElement = [elements nextObject];
while (currentElement)
{
[jsonElements addObject: [currentElement jsonRepresentation]];
currentElement = [elements nextObject];
}
while ((currentElement = [elements nextObject]))
[jsonElements addObject: [currentElement jsonRepresentation]];
representation = [NSString stringWithFormat: @"[%@]",
[jsonElements componentsJoinedByString: @", "]];
[jsonElements autorelease];
return representation;
}

View File

@@ -29,10 +29,11 @@
#import <Foundation/NSCharacterSet.h>
#import <NGExtensions/NGBase64Coding.h>
#import <SoObjects/SOGo/NSString+Utilities.h>
#import "NSArray+Utilities.h"
#import "NSObject+Utilities.h"
#import "NSString+Utilities.h"
#import "NSDictionary+Utilities.h"
@implementation NSDictionary (SOGoDictionaryUtilities)
@@ -43,15 +44,14 @@
NSMutableData *content;
NSDictionary *newDictionary;
content = [NSMutableData new];
content = [NSMutableData data];
[content appendBytes: "{" length: 1];
[content appendData: [NSData dataWithContentsOfFile: file]];
[content appendBytes: "}" length: 1];
serialized = [[NSString alloc] initWithData: content
encoding: NSUTF8StringEncoding];
[content release];
[serialized autorelease];
newDictionary = [serialized propertyList];
[serialized release];
return newDictionary;
}
@@ -62,20 +62,17 @@
NSString *representation, *currentKey, *currentValue, *currentPair;
NSEnumerator *keys;
values = [NSMutableArray new];
values = [NSMutableArray array];
keys = [[self allKeys] objectEnumerator];
currentKey = [keys nextObject];
while (currentKey)
while ((currentKey = [keys nextObject]))
{
currentValue = [[self objectForKey: currentKey] jsonRepresentation];
currentPair = [NSString stringWithFormat: @"%@: %@",
[currentKey jsonRepresentation], currentValue];
[values addObject: currentPair];
currentKey = [keys nextObject];
}
representation = [NSString stringWithFormat: @"{%@}",
[values componentsJoinedByString: @", "]];
[values release];
return representation;
}
@@ -202,6 +199,4 @@
@" the number of keys."];
}
@end

View File

@@ -1,6 +1,6 @@
ifeq ($(test-uninitialized),yes)
ifeq ($(debug),yes)
ADDITIONAL_OBJCFLAGS=-O1
ADDITIONAL_OBJCFLAGS=-O0
else
ADDITIONAL_OBJCFLAGS=-Wuninitialized
endif