From 662431c5854510a92b20c82a398bd93249a9bf21 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Wed, 11 Apr 2007 19:51:07 +0000 Subject: [PATCH] Monotone-Parent: 9f9de7a3557546682618d6d9810573aa4a35d4d7 Monotone-Revision: 623ad0c87ffb3644e0f387cc6a9170c151f10621 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-04-11T19:51:07 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 2 ++ SoObjects/SOGo/NSString+Utilities.h | 4 ++++ SoObjects/SOGo/NSString+Utilities.m | 17 +++++++++++++++++ UI/SOGoUI/UIxComponent.m | 3 ++- 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 52bfa810f..7bd0848d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * SoObjects/SOGo/NSString+Utilities.m ([NSString -boolValue]): new method that SOGo will need with non-gnustep Foundation implementation. + ([NSString -stringByAppendingPathComponent:component]): new method + that SOGo will need when building with libFoundation. * SoObjects/SOGo/SOGoUser.m ([SOGoUser -timeZone]): method moved from SOGoObject.m. diff --git a/SoObjects/SOGo/NSString+Utilities.h b/SoObjects/SOGo/NSString+Utilities.h index ff120c2f7..4e67f4a58 100644 --- a/SoObjects/SOGo/NSString+Utilities.h +++ b/SoObjects/SOGo/NSString+Utilities.h @@ -40,6 +40,10 @@ #ifndef GNUSTEP_BASE_LIBRARY - (BOOL) boolValue; + +#ifdef LIB_FOUNDATION_LIBRARY +- (NSString *) stringByAppendingPathComponent: (NSString *) component +#endif #endif @end diff --git a/SoObjects/SOGo/NSString+Utilities.m b/SoObjects/SOGo/NSString+Utilities.m index 675364843..00a59b299 100644 --- a/SoObjects/SOGo/NSString+Utilities.m +++ b/SoObjects/SOGo/NSString+Utilities.m @@ -106,6 +106,23 @@ return !([self isEqualToString: @"0"] || [self isEqualToString: @"NO"]); } + +#ifdef LIB_FOUNDATION_LIBRARY +- (NSString *) stringByAppendingPathComponent: (NSString *) component +{ + NSMutableArray *components; + NSString *newString; + + components = [NSMutableArray new]; + [components addObjectsFromArray: [self componentsSeparatedByString: @"/"]]; + [components addObject: component]; + newString = [components componentsJoinedByString: @"/"]; + [components release]; + + return newString; +} +#endif + #endif @end diff --git a/UI/SOGoUI/UIxComponent.m b/UI/SOGoUI/UIxComponent.m index 1ac4b49f6..55c5af175 100644 --- a/UI/SOGoUI/UIxComponent.m +++ b/UI/SOGoUI/UIxComponent.m @@ -19,6 +19,7 @@ 02111-1307, USA. */ +#import #import #import #import @@ -365,7 +366,7 @@ static BOOL uixDebugEnabled = NO; { NSString *dst, *rel; - dst = [[self userFolderPath] stringByAppendingPathComponent:_sub]; + dst = [[self userFolderPath] stringByAppendingPathComponent: _sub]; rel = [dst urlPathRelativeToPath:[self ownPath]]; return rel;