Monotone-Parent: f69c7f912f9958f232e0641fbdf872d37a2aa9bd
Monotone-Revision: 0575b0625d349718d3a000c6d46cac95612e6cfb Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2010-02-18T22:34:51 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
bb13d2b0b5
commit
f0ba13c1dc
|
@ -1,5 +1,11 @@
|
||||||
2010-02-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
2010-02-18 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||||
|
|
||||||
|
* SoObjects/SOGo/SOGoProductLoader.m (-loadAllProducts): new name
|
||||||
|
for "loadProducts". Do not list product directories where no
|
||||||
|
products were loaded.
|
||||||
|
(-loadProducts:): new method accepting an array of products to
|
||||||
|
load from SOGo library directories.
|
||||||
|
|
||||||
* SoObjects/SOGo/SOGoBuild.m: moved from Main/build.h to here.
|
* SoObjects/SOGo/SOGoBuild.m: moved from Main/build.h to here.
|
||||||
|
|
||||||
* SoObjects/SOGo/SOGoProductLoader.m: moved from Main/ to here.
|
* SoObjects/SOGo/SOGoProductLoader.m: moved from Main/ to here.
|
||||||
|
|
|
@ -134,7 +134,7 @@ static BOOL debugLeaks;
|
||||||
localeLUT = [[NSMutableDictionary alloc] initWithCapacity:2];
|
localeLUT = [[NSMutableDictionary alloc] initWithCapacity:2];
|
||||||
|
|
||||||
/* load products */
|
/* load products */
|
||||||
[[SOGoProductLoader productLoader] loadProducts];
|
[[SOGoProductLoader productLoader] loadAllProducts];
|
||||||
|
|
||||||
/* setup resource manager */
|
/* setup resource manager */
|
||||||
rm = [[WEResourceManager alloc] init];
|
rm = [[WEResourceManager alloc] init];
|
||||||
|
|
|
@ -32,11 +32,12 @@
|
||||||
NSArray *searchPathes;
|
NSArray *searchPathes;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id)productLoader;
|
+ (id) productLoader;
|
||||||
|
|
||||||
/* operations */
|
/* operations */
|
||||||
|
|
||||||
- (void)loadProducts;
|
- (void) loadAllProducts;
|
||||||
|
- (void) loadProducts: (NSArray *) products;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,52 @@ static NSString *productDirectoryName = @"SOGo";
|
||||||
return searchPathes;
|
return searchPathes;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) loadProducts
|
- (void) loadAllProducts
|
||||||
|
{
|
||||||
|
SoProductRegistry *registry = nil;
|
||||||
|
NSFileManager *fm;
|
||||||
|
NSMutableArray *loadedProducts;
|
||||||
|
NSEnumerator *pathes;
|
||||||
|
NSString *lpath, *bpath;
|
||||||
|
NSEnumerator *productNames;
|
||||||
|
NSString *productName;
|
||||||
|
NSAutoreleasePool *pool;
|
||||||
|
|
||||||
|
pool = [NSAutoreleasePool new];
|
||||||
|
|
||||||
|
registry = [SoProductRegistry sharedProductRegistry];
|
||||||
|
fm = [NSFileManager defaultManager];
|
||||||
|
|
||||||
|
loadedProducts = [NSMutableArray array];
|
||||||
|
|
||||||
|
pathes = [[self productSearchPathes] objectEnumerator];
|
||||||
|
while ((lpath = [pathes nextObject]))
|
||||||
|
{
|
||||||
|
productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator];
|
||||||
|
while ((productName = [productNames nextObject]))
|
||||||
|
{
|
||||||
|
if ([[productName pathExtension] isEqualToString: @"SOGo"])
|
||||||
|
{
|
||||||
|
bpath = [lpath stringByAppendingPathComponent: productName];
|
||||||
|
[registry registerProductAtPath: bpath];
|
||||||
|
[loadedProducts addObject: productName];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ([loadedProducts count])
|
||||||
|
{
|
||||||
|
[self logWithFormat: @"SOGo products loaded from '%@':", lpath];
|
||||||
|
[self logWithFormat: @" %@",
|
||||||
|
[loadedProducts componentsJoinedByString: @", "]];
|
||||||
|
[loadedProducts removeAllObjects];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![registry loadAllProducts])
|
||||||
|
[self warnWithFormat: @"could not load all products !"];
|
||||||
|
[pool release];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) loadProducts: (NSArray *) products
|
||||||
{
|
{
|
||||||
SoProductRegistry *registry = nil;
|
SoProductRegistry *registry = nil;
|
||||||
NSFileManager *fm;
|
NSFileManager *fm;
|
||||||
|
@ -121,16 +166,12 @@ static NSString *productDirectoryName = @"SOGo";
|
||||||
pathes = [[self productSearchPathes] objectEnumerator];
|
pathes = [[self productSearchPathes] objectEnumerator];
|
||||||
while ((lpath = [pathes nextObject]))
|
while ((lpath = [pathes nextObject]))
|
||||||
{
|
{
|
||||||
[self logWithFormat: @"scanning SOGo products in: %@", lpath];
|
|
||||||
|
|
||||||
productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator];
|
productNames = [[fm directoryContentsAtPath: lpath] objectEnumerator];
|
||||||
while ((productName = [productNames nextObject]))
|
while ((productName = [productNames nextObject]))
|
||||||
{
|
{
|
||||||
if ([[productName pathExtension] isEqualToString: @"SOGo"])
|
if ([products containsObject: productName])
|
||||||
{
|
{
|
||||||
bpath = [lpath stringByAppendingPathComponent: productName];
|
bpath = [lpath stringByAppendingPathComponent: productName];
|
||||||
[self logWithFormat: @" register SOGo product: %@",
|
|
||||||
productName];
|
|
||||||
[registry registerProductAtPath: bpath];
|
[registry registerProductAtPath: bpath];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue