Monotone-Parent: c98cf880ac8acb55a11ef10036185bef0a89375d

Monotone-Revision: e614ca6146bb5052469a2b393909509aa081acc0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-10-27T16:24:29
Monotone-Branch: ca.inverse.sogo
maint-2.0.2
Wolfgang Sourdeau 2010-10-27 16:24:29 +00:00
parent af44bf3901
commit e5dbe26e96
4 changed files with 37 additions and 2 deletions

View File

@ -74,6 +74,8 @@
to: (NSString *) aValue;
- (NSString *) namedValue: (NSString *) aValueName;
- (void) setCommaSeparatedValues: (NSArray *) values;
- (void) setValue: (unsigned int) anInt
ofAttribute: (NSString *) anAttribute
to: (NSString *) aValue;

View File

@ -362,6 +362,28 @@
return value;
}
- (void) setCommaSeparatedValues: (NSArray *) newValues
{
NSMutableString *newValue;
NSUInteger count, max;
NSString *currentValue;
newValue = [NSMutableString stringWithCapacity: 250];
max = [newValues count];
for (count = 0; count < max; count++)
{
currentValue = [[newValues objectAtIndex: count]
stringByReplacingString: @","
withString: @"\\,"];
if (count > 0)
[newValue appendFormat: @",%@", currentValue];
else
[newValue appendString: currentValue];
}
[self setValues: [NSArray arrayWithObject: newValue]];
}
- (void) setValue: (unsigned int) anInt
ofAttribute: (NSString *) anAttribute
to: (NSString *) aValue

View File

@ -1,3 +1,12 @@
2010-10-27 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* NGVCard.m (-setCategories): make use of the new method below.
(-categories): make use of value 0 and of the
vCardSubvaluesWithSeparator: category method.
* CardElement.m (-setCommaSeparatedValues): temporary helper for
versit fields that are using the comma as value separator.
2010-10-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* NGVCard.m (-setCategories, -categories): new accessors for the

View File

@ -25,6 +25,7 @@
#import <Foundation/NSString.h>
#import "NSArray+NGCards.h"
#import "NSString+NGCards.h"
#import "NGVCardPhoto.h"
@ -330,7 +331,8 @@
CardElement *cats;
cats = [self uniqueChildWithTag: @"categories"];
[cats setValues: newCategories];
[cats setCommaSeparatedValues: newCategories];
}
- (NSArray *) categories
@ -339,7 +341,7 @@
cats = [self uniqueChildWithTag: @"categories"];
return [cats values];
return [[cats value: 0] vCardSubvaluesWithSeparator: ','];
}
// - (void) setOrg: (NGVCardOrg *) _v