From 5e3d3435d93b3233511af46ac454a0dc56ef1d6f Mon Sep 17 00:00:00 2001 From: wolfgang Date: Tue, 3 Jul 2007 14:18:20 +0000 Subject: [PATCH] git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1095 d1b88da0-ebda-0310-925b-ed51d893ca5b --- ChangeLog | 10 ++++++++ Main/SOGo.m | 2 ++ Main/SOGoProductLoader.m | 53 ++++++++++++++++++++++------------------ 3 files changed, 41 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 176fc004..fdaa48b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-07-03 Wolfgang Sourdeau + + * Main/SOGoProductLoader.m: only load bundle directories ending + with the "SOGo" extension. + + * Main/SOGo.m ([SOGo + -_checkTableWithCM:cmtableURL:urlandType:tableType]): empty the + result set if the query has caused no exception. Otherwise we get + an "evaluation is in progress exception". + 2007-06-29 Wolfgang Sourdeau * SoObjects/SOGo/AgenorUserDefaults.m ([AgenorUserDefaults diff --git a/Main/SOGo.m b/Main/SOGo.m index b4afe3a2..efe2accf 100644 --- a/Main/SOGo.m +++ b/Main/SOGo.m @@ -169,6 +169,8 @@ static BOOL debugObjectAllocation = NO; [NSString stringWithContentsOfFile: descFile]]) [self logWithFormat: @"table '%@' successfully created!", tableName]; } + else + [tc cancelFetch]; [cm releaseChannel: tc]; diff --git a/Main/SOGoProductLoader.m b/Main/SOGoProductLoader.m index 57de2784..c5ed1ef2 100644 --- a/Main/SOGoProductLoader.m +++ b/Main/SOGoProductLoader.m @@ -146,35 +146,40 @@ - (void)loadProducts { SoProductRegistry *registry = nil; NSFileManager *fm; - NSEnumerator *pathes; - NSString *lpath; - + NSEnumerator *pathes; + NSString *lpath, *bpath, *extension; + NSEnumerator *productNames; + NSString *productName; + registry = [SoProductRegistry sharedProductRegistry]; fm = [NSFileManager defaultManager]; pathes = [[self productSearchPathes] objectEnumerator]; - while ((lpath = [pathes nextObject]) != nil) { - NSEnumerator *productNames; - NSString *productName; - - [self logWithFormat:@"scanning SOGo products in: %@", lpath]; - - productNames = [[fm directoryContentsAtPath:lpath] objectEnumerator]; - - while ((productName = [productNames nextObject]) != nil) { - NSString *bpath; - - if ([[productName pathExtension] length] == 0) - /* filter out directories without extensions */ - continue; - - bpath = [lpath stringByAppendingPathComponent:productName]; - [self logWithFormat:@" register SOGo product: %@", - [bpath lastPathComponent]]; - [registry registerProductAtPath:bpath]; + lpath = [pathes nextObject]; + while (lpath) + { + [self logWithFormat:@"scanning SOGo products in: %@", lpath]; + + productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator]; + + productName = [productNames nextObject]; + while (productName) + { + extension = [productName pathExtension]; + if ([extension length] > 0 + && [extension isEqualToString: @"SOGo"]) + { + bpath = [lpath stringByAppendingPathComponent: productName]; + [self logWithFormat:@" register SOGo product: %@", + productName]; + [registry registerProductAtPath: bpath]; + } + productName = [productNames nextObject]; + } + + lpath = [pathes nextObject]; } - } - + if (![registry loadAllProducts]) [self warnWithFormat:@"could not load all products !"]; } -- 2.39.5