Monotone-Parent: a93dd2767c4f017932c6339f82394fd558ef304f
Monotone-Revision: 7e63e5fdd760a91e91ec6f1759064a5e5c2f267f Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-10-23T15:35:20 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
94e1d60312
commit
b6201ae20a
|
@ -1,3 +1,11 @@
|
|||
2008-10-23 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* SoObjects/SOGo/NSArray+Utilities.m ([NSArray
|
||||
-objectsForKey:keynotFoundMarker:marker]): added a
|
||||
"notFoundMarker:" parameter to the "objectsForKey:" method. When
|
||||
the marker is nil and no match is found in the current dictionary,
|
||||
the entry is ignored.
|
||||
|
||||
2008-10-21 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/Contacts/UIxContactFoldersView.m ([UIxContactFoldersView
|
||||
|
|
|
@ -47,18 +47,14 @@
|
|||
|
||||
accounts = [[context activeUser] mailAccounts];
|
||||
|
||||
return [accounts objectsForKey: @"name"];
|
||||
return [accounts objectsForKey: @"name" notFoundMarker: nil];
|
||||
}
|
||||
|
||||
/* name lookup */
|
||||
|
||||
- (BOOL) isValidMailAccountName: (NSString *) _key
|
||||
{
|
||||
NSArray *accounts;
|
||||
|
||||
accounts = [[context activeUser] mailAccounts];
|
||||
|
||||
return [[accounts objectsForKey: @"name"] containsObject: _key];
|
||||
return [[self toManyRelationshipKeys] containsObject: _key];
|
||||
}
|
||||
|
||||
// - (id) mailAccountWithName: (NSString *) _key
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
|
||||
if ([keys count])
|
||||
{
|
||||
types = [keys objectsForKey: @"mimeType"];
|
||||
types = [keys objectsForKey: @"mimeType" notFoundMarker: @""];
|
||||
index = [types indexOfObject: @"text/plain"];
|
||||
if (index == NSNotFound)
|
||||
{
|
||||
|
|
|
@ -605,7 +605,8 @@ static BOOL debugSoParts = NO;
|
|||
|
||||
[self debugWithFormat: @"fetch keys: %@", _fetchKeys];
|
||||
|
||||
result = [self fetchParts: [_fetchKeys objectsForKey: @"key"]];
|
||||
result = [self fetchParts: [_fetchKeys objectsForKey: @"key"
|
||||
notFoundMarker: nil]];
|
||||
result = [result valueForKey: @"RawResponse"]; // hackish
|
||||
|
||||
// Note: -valueForKey: doesn't work!
|
||||
|
|
|
@ -35,7 +35,8 @@
|
|||
|
||||
- (NSArray *) stringsWithFormat: (NSString *) format;
|
||||
- (NSArray *) keysWithFormat: (NSString *) format;
|
||||
- (NSArray *) objectsForKey: (NSString *) key;
|
||||
- (NSArray *) objectsForKey: (NSString *) key
|
||||
notFoundMarker: (id) marker;
|
||||
- (NSArray *) flattenedArray;
|
||||
|
||||
- (NSArray *) uniqueObjects;
|
||||
|
|
|
@ -85,6 +85,7 @@
|
|||
}
|
||||
|
||||
- (NSArray *) objectsForKey: (NSString *) key
|
||||
notFoundMarker: (id) marker
|
||||
{
|
||||
NSMutableArray *objectsForKey;
|
||||
unsigned int count, max;
|
||||
|
@ -96,7 +97,10 @@
|
|||
for (count = 0; count < max; count++)
|
||||
{
|
||||
value = [[self objectAtIndex: count] objectForKey: key];
|
||||
[objectsForKey addObject: value];
|
||||
if (value)
|
||||
[objectsForKey addObject: value];
|
||||
else if (marker)
|
||||
[objectsForKey addObject: marker];
|
||||
}
|
||||
|
||||
return objectsForKey;
|
||||
|
|
|
@ -467,7 +467,7 @@ static NSArray *childRecordFields = nil;
|
|||
return records;
|
||||
|
||||
[childRecords release];
|
||||
names = [records objectsForKey: @"c_name"];
|
||||
names = [records objectsForKey: @"c_name" notFoundMarker: nil];
|
||||
childRecords = [[NSMutableDictionary alloc] initWithObjects: records
|
||||
forKeys: names];
|
||||
|
||||
|
|
|
@ -751,8 +751,8 @@ _timeValue (NSString *key)
|
|||
{
|
||||
NSArray *identities;
|
||||
|
||||
[self mailAccounts];
|
||||
identities = [mailAccounts objectsForKey: @"identities"];
|
||||
identities = [[self mailAccounts] objectsForKey: @"identities"
|
||||
notFoundMarker: nil];
|
||||
|
||||
return [identities flattenedArray];
|
||||
}
|
||||
|
|
|
@ -274,11 +274,11 @@
|
|||
parts = [[message objectForKey: @"body"] objectForKey: @"parts"];
|
||||
if ([parts count] > 1)
|
||||
{
|
||||
dispositions
|
||||
= [[parts objectsForKey: @"disposition"] objectEnumerator];
|
||||
dispositions = [[parts objectsForKey: @"disposition"
|
||||
notFoundMarker: nil] objectEnumerator];
|
||||
while (!hasAttachment
|
||||
&& (currentDisp = [dispositions nextObject]))
|
||||
hasAttachment = ([[currentDisp objectForKey: @"type"] length]);
|
||||
hasAttachment = ([[currentDisp objectForKey: @"type"] length]);
|
||||
}
|
||||
|
||||
return hasAttachment;
|
||||
|
|
|
@ -69,12 +69,14 @@
|
|||
}
|
||||
|
||||
/* accessors */
|
||||
|
||||
#warning this method is a duplication of SOGoMailAccounts:toManyRelationShipKeys
|
||||
- (NSString *) mailAccounts
|
||||
{
|
||||
NSArray *accounts, *accountNames;
|
||||
|
||||
accounts = [[context activeUser] mailAccounts];
|
||||
accountNames = [accounts objectsForKey: @"name"];
|
||||
accountNames = [accounts objectsForKey: @"name" notFoundMarker: nil];
|
||||
|
||||
return [accountNames jsonRepresentation];
|
||||
}
|
||||
|
@ -183,7 +185,8 @@
|
|||
|
||||
// We use the first mail account
|
||||
accounts = [[context activeUser] mailAccounts];
|
||||
firstAccount = [[accounts objectsForKey: @"name"] objectAtIndex: 0];
|
||||
firstAccount = [[accounts objectsForKey: @"name" notFoundMarker: nil]
|
||||
objectAtIndex: 0];
|
||||
request = [context request];
|
||||
|
||||
if ((folderId = [request formValueForKey: @"folder"]) &&
|
||||
|
|
Loading…
Reference in New Issue