diff --git a/ChangeLog b/ChangeLog index 217f522d8..7a3ae543f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,18 @@ 2009-03-18 Wolfgang Sourdeau + * Main/sogod.m (convertOldSOGoDomain): new function that convert + the old "sogod-0.9" NSUserDefaults domain to "sogod". + + * Main/SOGoProductLoader.m ([SOGoProductLoader + +sogoMajorVersion]): removed useless method. + ([SOGoProductLoader +sogoMinorVersion]): removed useless method. + ([SOGoProductLoader -init]): productDirectoryName is no longer an + ivar but a static string. + ([SOGoProductLoader -productSearchPathes]): removed FHS paths from + search paths. + + * Main/SOGo.m ([SOGo -name]): returns "SOGo". + * SoObjects/SOGo/SOGoParentFolder.m ([SOGoParentFolder -appendPersonalSources]): returns an NSException. ([SOGoParentFolder -appendSystemSources]): same as above. diff --git a/Main/GNUmakefile b/Main/GNUmakefile index 0c0c13231..d8d1b3398 100644 --- a/Main/GNUmakefile +++ b/Main/GNUmakefile @@ -8,7 +8,7 @@ include ./Version ADDITIONAL_INCLUDE_DIRS += -I../SOPE/ -D_GNU_SOURCE ADDITIONAL_LIB_DIRS += -L../SOPE/GDLContentStore/obj/ -SOGOD = sogod-$(MAJOR_VERSION).$(MINOR_VERSION) +SOGOD = sogod TOOL_NAME = $(SOGOD) $(SOGOD)_INSTALL_DIR = $(SOGO_ADMIN_TOOLS) diff --git a/Main/SOGo.m b/Main/SOGo.m index 11a4bad6b..abf671bd8 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -602,7 +602,7 @@ static BOOL debugObjectAllocation = NO; - (NSString *) name { - return @"SOGo-0.9"; + return @"SOGo"; } @end /* SOGo */ diff --git a/Main/SOGoProductLoader.h b/Main/SOGoProductLoader.h index fc8668dbb..ea85e512d 100644 --- a/Main/SOGoProductLoader.h +++ b/Main/SOGoProductLoader.h @@ -29,7 +29,6 @@ @interface SOGoProductLoader : NSObject { - NSString *productDirectoryName; NSArray *searchPathes; } diff --git a/Main/SOGoProductLoader.m b/Main/SOGoProductLoader.m index fe08a0815..d942ebd99 100644 --- a/Main/SOGoProductLoader.m +++ b/Main/SOGoProductLoader.m @@ -30,38 +30,17 @@ #import "SOGoProductLoader.h" +static NSString *productDirectoryName = @"SOGo"; + @implementation SOGoProductLoader -+ (int) sogoMajorVersion -{ - return SOGO_MAJOR_VERSION; -} - -+ (int) sogoMinorVersion -{ - return SOGO_MINOR_VERSION; -} - + (id) productLoader { return [[self new] autorelease]; } -- (id) init -{ - if ((self = [super init])) - { - productDirectoryName = - [[NSString alloc] initWithFormat: @"SOGo-%i.%i", - [[self class] sogoMajorVersion], - [[self class] sogoMinorVersion]]; - } - return self; -} - - (void) dealloc { - [productDirectoryName release]; [searchPathes release]; [super dealloc]; } @@ -99,15 +78,6 @@ [directory stringByAppendingPathComponent: productDirectoryName]]; } -- (void) _addFHSPathesToArray: (NSMutableArray *) ma -{ - NSString *s; - - s = @"sogod-0.9"; - [ma addObject: [NSString stringWithFormat: @"/usr/local/lib/%@", s]]; - [ma addObject: [NSString stringWithFormat: @"/usr/lib/%@", s]]; -} - - (NSArray *) productSearchPathes { NSMutableArray *ma; @@ -122,8 +92,6 @@ [self _addCocoaSearchPathesToArray: ma]; #endif - [self _addFHSPathesToArray: ma]; - searchPathes = [ma copy]; if ([searchPathes count] == 0) diff --git a/Main/sogod.m b/Main/sogod.m index 52a4018ae..fe67168cb 100644 --- a/Main/sogod.m +++ b/Main/sogod.m @@ -55,6 +55,25 @@ BootstrapNSUserDefaults () } } +static void +convertOldSOGoDomain (NSUserDefaults *ud) +{ + NSDictionary *domain; + + domain = [ud persistentDomainForName: @"sogod"]; + if (![domain count]) + { + domain = [ud persistentDomainForName: @"sogod-0.9"]; + if ([domain count]) + { + NSLog (@"migrating user defaults from sogod-0.9"); + [ud setPersistentDomain: domain forName: @"sogod"]; + [ud removePersistentDomainForName: @"sogod-0.9"]; + [ud synchronize]; + } + } +} + int main (int argc, char **argv, char **env) { @@ -76,6 +95,8 @@ main (int argc, char **argv, char **env) count: argc environment: env]; #endif ud = [NSUserDefaults standardUserDefaults]; + convertOldSOGoDomain (ud); + rc = 0; tzName = [ud stringForKey: @"SOGoServerTimeZone"]; if (!tzName) diff --git a/UI/WebServerResources/SOGoRootPage.js b/UI/WebServerResources/SOGoRootPage.js index b3fa3d2cb..4a5a162aa 100644 --- a/UI/WebServerResources/SOGoRootPage.js +++ b/UI/WebServerResources/SOGoRootPage.js @@ -3,7 +3,7 @@ function initLogin() { var date = new Date(); date.setTime(date.getTime() - 86400000); - document.cookie = ("0xHIGHFLYxSOGo-0.9=discard; path=/" + document.cookie = ("0xHIGHFLYxSOGo=discard; path=/" + "; expires=" + date.toGMTString()); var submit = $("submit"); submit.observe("click", onLoginClick); @@ -56,7 +56,7 @@ function onLoginCallback(http) { for (var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') c = c.substring(1, c.length); - if (c.indexOf("0xHIGHFLYxSOGo-0.9=") == 0) { + if (c.indexOf("0xHIGHFLYxSOGo=") == 0) { cookieExists = 1; break; } diff --git a/configure b/configure index 6ef244abf..737ebc583 100755 --- a/configure +++ b/configure @@ -249,7 +249,7 @@ genConfigMake() { fi cfgwrite "SOGO_SYSLIBDIR=\${GNUSTEP_LIBRARIES}" - cfgwrite "SOGO_LIBDIR=\${GNUSTEP_LIBRARY}/SOGo-\${SOGO_MAJOR_VERSION}.\${SOGO_MINOR_VERSION}" + cfgwrite "SOGO_LIBDIR=\${GNUSTEP_LIBRARY}/SOGo" cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_LIBDIR}/Templates" cfgwrite "SOGO_WEBSERVERRESOURCESDIR=\${SOGO_LIBDIR}/WebServerResources" cfgwrite "SOGO_TOOLS=\${GNUSTEP_TOOLS}"