mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 02:00:48 +00:00
[_loadAvailableColorLists] check if a directory exists before
looking for a colour list in it. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15911 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7925725bb9
commit
5b3f1e1bbf
1 changed files with 11 additions and 2 deletions
|
@ -90,16 +90,25 @@ static NSLock *_gnustep_color_list_lock = nil;
|
||||||
|
|
||||||
while ((dir = (NSString *)[e nextObject]))
|
while ((dir = (NSString *)[e nextObject]))
|
||||||
{
|
{
|
||||||
|
BOOL flag;
|
||||||
|
|
||||||
dir = [dir stringByAppendingPathComponent: @"Colors"];
|
dir = [dir stringByAppendingPathComponent: @"Colors"];
|
||||||
|
if (![fm fileExistsAtPath: dir isDirectory: &flag] || !flag)
|
||||||
|
{
|
||||||
|
// Only process existing directories
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
de = [fm enumeratorAtPath: dir];
|
de = [fm enumeratorAtPath: dir];
|
||||||
while ((file = [de nextObject]))
|
while ((file = [de nextObject]))
|
||||||
{
|
{
|
||||||
if ([[file pathExtension] isEqualToString: @"clr"])
|
if ([[file pathExtension] isEqualToString: @"clr"])
|
||||||
{
|
{
|
||||||
file = [file stringByDeletingPathExtension];
|
file = [file stringByDeletingPathExtension];
|
||||||
newList = AUTORELEASE ([[NSColorList alloc] initWithName: file
|
newList = [[NSColorList alloc] initWithName: file
|
||||||
fromFile: dir]);
|
fromFile: dir];
|
||||||
[_gnustep_available_color_lists addObject: newList];
|
[_gnustep_available_color_lists addObject: newList];
|
||||||
|
RELEASE(newList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue