Monotone-Parent: 490ba5f20c6d08910205f97565f54a96c5bb9390
Monotone-Revision: 0f3aafc403820746fc56245b1d4213e81078b7d1 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2008-05-02T23:14:26 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
87af33d14f
commit
9f3c5e3d0c
|
@ -1,5 +1,8 @@
|
|||
2008-05-02 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* Main/SOGo.m ([SOGo -davURL], [SOGo -soURL]): copied methods from
|
||||
SOGoObject.
|
||||
|
||||
* SoObjects/SOGo/SOGoUserFolder.m ([SOGoUserFolder
|
||||
-davDisplayName]): new overriden method to provide a display name
|
||||
to the users principal.
|
||||
|
|
47
Main/SOGo.m
47
Main/SOGo.m
|
@ -39,6 +39,7 @@
|
|||
#import <NGExtensions/NSObject+Logs.h>
|
||||
#import <NGExtensions/NSProcessInfo+misc.h>
|
||||
#import <NGExtensions/NSString+Encoding.h>
|
||||
#import <NGExtensions/NSString+misc.h>
|
||||
|
||||
#import <WEExtensions/WEResourceManager.h>
|
||||
|
||||
|
@ -515,6 +516,52 @@ static BOOL debugObjectAllocation = NO;
|
|||
return locale;
|
||||
}
|
||||
|
||||
- (NSURL *) _urlPreferringParticle: (NSString *) expected
|
||||
overThisOne: (NSString *) possible
|
||||
{
|
||||
NSURL *serverURL, *url;
|
||||
NSMutableArray *path;
|
||||
NSString *baseURL, *urlMethod;
|
||||
WOContext *context;
|
||||
|
||||
context = [self context];
|
||||
serverURL = [context serverURL];
|
||||
baseURL = [[self baseURLInContext: context] stringByUnescapingURL];
|
||||
path = [NSMutableArray arrayWithArray: [baseURL componentsSeparatedByString:
|
||||
@"/"]];
|
||||
if ([baseURL hasPrefix: @"http"])
|
||||
{
|
||||
[path removeObjectAtIndex: 1];
|
||||
[path removeObjectAtIndex: 0];
|
||||
[path replaceObjectAtIndex: 0 withObject: @""];
|
||||
}
|
||||
urlMethod = [path objectAtIndex: 2];
|
||||
if (![urlMethod isEqualToString: expected])
|
||||
{
|
||||
if ([urlMethod isEqualToString: possible])
|
||||
[path replaceObjectAtIndex: 2 withObject: expected];
|
||||
else
|
||||
[path insertObject: expected atIndex: 2];
|
||||
}
|
||||
|
||||
url = [[NSURL alloc] initWithScheme: [serverURL scheme]
|
||||
host: [serverURL host]
|
||||
path: [path componentsJoinedByString: @"/"]];
|
||||
[url autorelease];
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
- (NSURL *) davURL
|
||||
{
|
||||
return [self _urlPreferringParticle: @"dav" overThisOne: @"so"];
|
||||
}
|
||||
|
||||
- (NSURL *) soURL
|
||||
{
|
||||
return [self _urlPreferringParticle: @"so" overThisOne: @"dav"];
|
||||
}
|
||||
|
||||
/* name (used by the WEResourceManager) */
|
||||
|
||||
- (NSString *) name
|
||||
|
|
Loading…
Reference in New Issue