mirror of
https://github.com/gnustep/libs-gsweb.git
synced 2025-05-31 09:11:11 +00:00
2003-03-03 Manuel Guesdon <mguesdon@orange-concept.com>
* GSWeb/GSWSessionTimeOutManager.m: o Better handling of lock during exceptions (should improve it) o logs * GSWeb/GSWSessionStore.m: o logs o raise exception when a direct GSWSessionStore is allocated * GSWeb/GSWrequest.m: o fixed typo on contentSubType * GSWeb/GSWDisplayGroup.hm o added _queryMinMatch to enable >= clause o added _queryMaxMatch to enable <= clause o added -queryMinMatch to enable >= clause o added -queryMaxMatch to enable <= clause o declare private methods * GSWeb/GSWDisplayGroup.m: o add NSAutoreleasePool use in -fetch * GSWeb/GSWExtensionsGSW.framework/GSWFileUploadComponent.gswc/GSWFileUploadComponent.gswd o bug fix in GSWHyperlink binding * GSWeb/GSWCheckBoxList.m o settable selections fix * GSWeb/GSWApplication.m: o logs * GSWeb/GSWSessionTimeOut.[hm] o added -lastAccessTimeDate and -timeOutTimeDate * GSWeb/GSWDeployedBundle.m: o add some NSAutoreleasePool use * GSWeb/GSWHyperlink.m: o fix to not display links disabled by !enabled when displayDisabled = NO. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gsweb/trunk@16110 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2e0c8afdee
commit
6104dbcda5
14 changed files with 466 additions and 210 deletions
|
@ -294,7 +294,7 @@ static char rcsId[] = "$Id$";
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
-(NSString*)lockedRelativePathForResourceNamed:(NSString*)aName
|
||||
forLanguages:(NSArray*)someLanguages
|
||||
forLanguages:(NSArray*)someLanguages
|
||||
{
|
||||
//OK
|
||||
NSString* path=nil;
|
||||
|
@ -365,58 +365,76 @@ static char rcsId[] = "$Id$";
|
|||
NSDebugMLLog(@"bundles",@"aName=%@ aDirectory=%@ aLanguage=%@",aName,aDirectory,aLanguage);
|
||||
if (aName)
|
||||
{
|
||||
NSString* emptyString=[NSString string];
|
||||
NSString* bundlePath=[self bundlePath];
|
||||
NSArray* keys;
|
||||
if ([aDirectory isEqualToString:@"."])
|
||||
aDirectory=nil;
|
||||
if (aLanguage)
|
||||
keys=[NSArray arrayWithObjects:aName,
|
||||
bundlePath ? bundlePath : emptyString,
|
||||
aDirectory ? aDirectory : emptyString,
|
||||
aLanguage ? aLanguage : emptyString,
|
||||
nil];
|
||||
else
|
||||
keys=[NSArray arrayWithObjects:aName,
|
||||
bundlePath ? bundlePath : emptyString,
|
||||
aDirectory ? aDirectory : emptyString,
|
||||
nil];
|
||||
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
|
||||
path=[_relativePathsCache objectForKeysArray:keys];
|
||||
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
||||
if (path==GSNotFoundMarker)
|
||||
path=nil;
|
||||
if (!path)
|
||||
NSAutoreleasePool* arp = [NSAutoreleasePool new];
|
||||
NS_DURING
|
||||
{
|
||||
//call again _relativePathForResourceNamed:inDirectory:forLanguage:
|
||||
NSString* completePathTest=nil;
|
||||
BOOL exists=NO;
|
||||
NSFileManager* fileManager=nil;
|
||||
NSString* pathTest=[NSString string];
|
||||
if (aDirectory)
|
||||
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
|
||||
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
||||
NSString* emptyString=[NSString string];
|
||||
NSString* bundlePath=[self bundlePath];
|
||||
NSArray* keys;
|
||||
if ([aDirectory isEqualToString:@"."])
|
||||
aDirectory=nil;
|
||||
if (aLanguage)
|
||||
pathTest=[pathTest stringByAppendingPathComponent:
|
||||
[aLanguage stringByAppendingString:GSLanguagePSuffix]];
|
||||
//NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||
pathTest=[pathTest stringByAppendingPathComponent:aName];
|
||||
NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||
completePathTest=[bundlePath stringByAppendingPathComponent:pathTest];
|
||||
NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest);
|
||||
fileManager=[NSFileManager defaultManager];
|
||||
exists=[fileManager fileExistsAtPath:completePathTest];
|
||||
NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO"));
|
||||
if (exists)
|
||||
{
|
||||
path=pathTest;
|
||||
[_relativePathsCache setObject:path
|
||||
forKeysArray:keys];
|
||||
}
|
||||
keys=[NSArray arrayWithObjects:aName,
|
||||
bundlePath ? bundlePath : emptyString,
|
||||
aDirectory ? aDirectory : emptyString,
|
||||
aLanguage ? aLanguage : emptyString,
|
||||
nil];
|
||||
else
|
||||
[_relativePathsCache setObject:GSNotFoundMarker
|
||||
forKeysArray:keys];
|
||||
};
|
||||
keys=[NSArray arrayWithObjects:aName,
|
||||
bundlePath ? bundlePath : emptyString,
|
||||
aDirectory ? aDirectory : emptyString,
|
||||
nil];
|
||||
//NSDebugMLLog(@"bundles",@"_keys=%@",_keys);
|
||||
path=[_relativePathsCache objectForKeysArray:keys];
|
||||
//NSDebugMLLog(@"bundles",@"_path=%@",_path);
|
||||
if (path==GSNotFoundMarker)
|
||||
path=nil;
|
||||
if (!path)
|
||||
{
|
||||
//call again _relativePathForResourceNamed:inDirectory:forLanguage:
|
||||
NSString* completePathTest=nil;
|
||||
BOOL exists=NO;
|
||||
NSFileManager* fileManager=nil;
|
||||
NSString* pathTest=[NSString string];
|
||||
if (aDirectory)
|
||||
pathTest=[pathTest stringByAppendingPathComponent:aDirectory];
|
||||
//NSDebugMLLog(@"bundles",@"_pathTest=%@",_pathTest);
|
||||
if (aLanguage)
|
||||
pathTest=[pathTest stringByAppendingPathComponent:
|
||||
[aLanguage stringByAppendingString:GSLanguagePSuffix]];
|
||||
//NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||
pathTest=[pathTest stringByAppendingPathComponent:aName];
|
||||
NSDebugMLLog(@"bundles",@"pathTest=%@",pathTest);
|
||||
completePathTest=[bundlePath stringByAppendingPathComponent:pathTest];
|
||||
NSDebugMLLog(@"bundles",@"completePathTest=%@",completePathTest);
|
||||
fileManager=[NSFileManager defaultManager];
|
||||
exists=[fileManager fileExistsAtPath:completePathTest];
|
||||
NSDebugMLLog(@"bundles",@"exists=%s",(exists ? "YES" : "NO"));
|
||||
if (exists)
|
||||
{
|
||||
path=pathTest;
|
||||
[_relativePathsCache setObject:path
|
||||
forKeysArray:keys];
|
||||
}
|
||||
else
|
||||
[_relativePathsCache setObject:GSNotFoundMarker
|
||||
forKeysArray:keys];
|
||||
};
|
||||
}
|
||||
NS_HANDLER
|
||||
{
|
||||
localException=ExceptionByAddingUserInfoObjectFrameInfo0(localException,
|
||||
@"lockedCachedRelativePathForResourceNamed:inDirectory:forLanguage:");
|
||||
LOGException(@"%@ (%@)",localException,[localException reason]);
|
||||
RETAIN(localException);
|
||||
DESTROY(arp);
|
||||
AUTORELEASE(localException);
|
||||
[localException raise];
|
||||
}
|
||||
NS_ENDHANDLER;
|
||||
RETAIN(path);
|
||||
DESTROY(arp);
|
||||
AUTORELEASE(path);
|
||||
};
|
||||
NSDebugMLLog(@"bundles",@"path=%@",path);
|
||||
LOGObjectFnStop();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue