Monotone-Parent: 3e115caf9292772485392f689415b1620ec81d9e

Monotone-Revision: 6c18461fde8c24d977a5536ff8d6c935f2d59268

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2007-07-20T20:22:16
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2007-07-20 20:22:16 +00:00
parent 82be9a876a
commit f4d8031101
2 changed files with 28 additions and 14 deletions

View File

@@ -1,5 +1,8 @@
2007-07-20 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/Contacts/UIxContactsListView.m ([UIxContactsListView
-contactInfos]): cache the results to avoid multiple invocations.
* SoObjects/Contacts/SOGoContactLDAPFolder.m
([SOGoContactLDAPFolder -toOneRelationshipKeys]): check whether we
really should return something or if we fake to return nil...

View File

@@ -26,8 +26,6 @@
#import <Contacts/SOGoContactFolder.h>
#import <Contacts/SOGoContactFolders.h>
#import "common.h"
#import "UIxContactsListView.h"
@implementation UIxContactsListView
@@ -37,11 +35,18 @@
if ((self = [super init]))
{
selectorComponentClass = nil;
contactInfos = nil;
}
return self;
}
- (void) dealloc
{
[contactInfos release];
[super dealloc];
}
/* accessors */
- (void) setCurrentContact: (NSDictionary *) _contact
@@ -118,21 +123,27 @@
NSString *ascending, *searchText, *valueText;
NSComparisonResult ordering;
folder = [self clientObject];
if (!contactInfos)
{
folder = [self clientObject];
ascending = [self queryParameterForKey: @"asc"];
ordering = ((![ascending length] || [ascending boolValue])
? NSOrderedAscending : NSOrderedDescending);
ascending = [self queryParameterForKey: @"asc"];
ordering = ((![ascending length] || [ascending boolValue])
? NSOrderedAscending : NSOrderedDescending);
searchText = [self queryParameterForKey: @"search"];
if ([searchText length] > 0)
valueText = [self queryParameterForKey: @"value"];
else
valueText = nil;
searchText = [self queryParameterForKey: @"search"];
if ([searchText length] > 0)
valueText = [self queryParameterForKey: @"value"];
else
valueText = nil;
return [folder lookupContactsWithFilter: valueText
sortBy: [self sortKey]
ordering: ordering];
ASSIGN (contactInfos,
[folder lookupContactsWithFilter: valueText
sortBy: [self sortKey]
ordering: ordering]);
}
return contactInfos;
}
/* actions */