From c8e8c4dff09567a619a40600108ea4d048263c73 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Nov 2009 18:59:52 +0000 Subject: [PATCH 1/2] Monotone-Parent: 3f1a705ea4e12fea3f816fcc523a8b481c081f11 Monotone-Revision: db65c7e35ae83bc91fdec247c1d3eba6847752da Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-20T18:59:52 Monotone-Branch: ca.inverse.sogo --- Main/SOGoProductLoader.m | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Main/SOGoProductLoader.m b/Main/SOGoProductLoader.m index b9b6eb5d1..f7c7a3b16 100644 --- a/Main/SOGoProductLoader.m +++ b/Main/SOGoProductLoader.m @@ -89,8 +89,7 @@ static NSString *productDirectoryName = @"SOGo"; [self _addGNUstepSearchPathesToArray: ma]; #if COCOA_Foundation_LIBRARY - else - [self _addCocoaSearchPathesToArray: ma]; + [self _addCocoaSearchPathesToArray: ma]; #endif searchPathes = [ma copy]; @@ -108,7 +107,7 @@ static NSString *productDirectoryName = @"SOGo"; SoProductRegistry *registry = nil; NSFileManager *fm; NSEnumerator *pathes; - NSString *lpath, *bpath, *extension; + NSString *lpath, *bpath; NSEnumerator *productNames; NSString *productName; @@ -123,9 +122,7 @@ static NSString *productDirectoryName = @"SOGo"; productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator]; while ((productName = [productNames nextObject])) { - extension = [productName pathExtension]; - if ([extension length] > 0 - && [extension isEqualToString: @"SOGo"]) + if ([[productName pathExtension] isEqualToString: @"SOGo"]) { bpath = [lpath stringByAppendingPathComponent: productName]; [self logWithFormat: @" register SOGo product: %@", From ef483a59ea008a41d0d6ed6e0e0f76ce1edfd18f Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Fri, 20 Nov 2009 19:02:39 +0000 Subject: [PATCH 2/2] Monotone-Parent: db65c7e35ae83bc91fdec247c1d3eba6847752da Monotone-Revision: 8c9e590b755c113a30dd211d600f834108d3d3c5 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2009-11-20T19:02:39 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 5 +++++ Main/sogod.m | 27 ++++++++++++--------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a1caa3a8..ebfdd69a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-11-20 Wolfgang Sourdeau + * Main/sogod.m (prepareUserDefaults): replaces + "convertOldSOGoDomain", automatically set WOMessageUseUTF8, + WOParsersUseUTF8 and NGUseUTF8AsURLEncoding to YES in the user + defaults. + * SoObjects/SOGo/SOGoUserDefaults.m (_sqlJsonRepresentation:): the escaping of "\\" was done in the wrong direction. (-storeJSONProfileInDB:): we commit the transaction to avoid a diff --git a/Main/sogod.m b/Main/sogod.m index 0ec2d3880..167fca2a8 100644 --- a/Main/sogod.m +++ b/Main/sogod.m @@ -56,8 +56,9 @@ BootstrapNSUserDefaults () } static void -convertOldSOGoDomain (NSUserDefaults *ud) +prepareUserDefaults (NSUserDefaults *ud) { + NSString *redirectURL; NSDictionary *domain; domain = [ud persistentDomainForName: @"sogod"]; @@ -72,12 +73,20 @@ convertOldSOGoDomain (NSUserDefaults *ud) [ud synchronize]; } } + + redirectURL = [ud stringForKey: @"WOApplicationRedirectURL"]; + if ([redirectURL hasSuffix: @"/"]) + [ud setObject: [redirectURL substringToIndex: [redirectURL length] - 1] + forKey: @"WOApplicationRedirectURL"]; + [ud setBool: YES forKey: @"WOMessageUseUTF8"]; + [ud setBool: YES forKey: @"WOParsersUseUTF8"]; + [ud setBool: YES forKey: @"NGUseUTF8AsURLEncoding"]; } int main (int argc, char **argv, char **env) { - NSString *tzName, *redirectURL; + NSString *tzName; NSUserDefaults *ud; NSAutoreleasePool *pool; int rc; @@ -90,20 +99,8 @@ main (int argc, char **argv, char **env) if (getuid() > 0) { -#if LIB_FOUNDATION_LIBRARY - [NSProcessInfo initializeWithArguments: argv - count: argc environment: env]; -#endif ud = [NSUserDefaults standardUserDefaults]; - convertOldSOGoDomain (ud); - - redirectURL = [ud stringForKey: @"WOApplicationRedirectURL"]; - if (redirectURL && [redirectURL hasSuffix: @"/"]) - { - [ud setObject: [redirectURL substringToIndex: [redirectURL length] - 1] - forKey: @"WOApplicationRedirectURL"]; - [ud synchronize]; - } + prepareUserDefaults (ud); rc = 0; tzName = [ud stringForKey: @"SOGoServerTimeZone"];