mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Fix bug recognising path extensions
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27309 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
734a6c759d
commit
50a4201f22
4 changed files with 18 additions and 22 deletions
|
@ -1,3 +1,8 @@
|
|||
2008-12-16 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/NSWorkspace.m: Fix problem failing to recognise path extension
|
||||
where the role is blank.
|
||||
|
||||
2008-12-16 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSButtonCell.m (-setImage:): Call super implementation to
|
||||
|
|
|
@ -654,8 +654,7 @@ static NSNull *null = nil;
|
|||
unsigned count;
|
||||
|
||||
imageTypes = [NSImage imageFileTypes];
|
||||
for (count = 0, image = nil; image == nil && count < [imageTypes count];
|
||||
count++)
|
||||
for (count = 0; count < [imageTypes count]; count++)
|
||||
{
|
||||
NSString *ext = [imageTypes objectAtIndex: count];
|
||||
|
||||
|
|
|
@ -151,9 +151,7 @@ setPath(NSBrowser *browser, NSString *path)
|
|||
NSString *file = [[names lastObject] stringByStandardizingPath];
|
||||
BOOL isDir;
|
||||
|
||||
if (file &&
|
||||
[_fm fileExistsAtPath: file isDirectory: &isDir] &&
|
||||
isDir)
|
||||
if (file && [_fm fileExistsAtPath: file isDirectory: &isDir] && isDir)
|
||||
{
|
||||
[self setDirectory: file];
|
||||
}
|
||||
|
@ -1666,14 +1664,13 @@ createRowsForColumn: (int)column
|
|||
exists = [_fm fileExistsAtPath: pathAndFile
|
||||
isDirectory: &isDir];
|
||||
if (isDir && !_treatsFilePackagesAsDirectories
|
||||
&& [ws isFilePackageAtPath: pathAndFile])
|
||||
&& [ws isFilePackageAtPath: pathAndFile])
|
||||
{
|
||||
isDir = NO;
|
||||
}
|
||||
if (_delegateHasShowFilenameFilter)
|
||||
{
|
||||
exists = [_delegate panel: self
|
||||
shouldShowFilename: pathAndFile];
|
||||
exists = [_delegate panel: self shouldShowFilename: pathAndFile];
|
||||
}
|
||||
|
||||
if (exists && !isDir)
|
||||
|
|
|
@ -1221,14 +1221,14 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
*/
|
||||
extension = [fullPath pathExtension];
|
||||
if ([extension isEqualToString: @"app"]
|
||||
|| [extension isEqualToString: @"debug"]
|
||||
|| [extension isEqualToString: @"profile"]
|
||||
|| [extension isEqualToString: @"bundle"])
|
||||
|| [extension isEqualToString: @"debug"]
|
||||
|| [extension isEqualToString: @"profile"]
|
||||
|| [extension isEqualToString: @"bundle"])
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
else if ([extension length] > 0
|
||||
&& [self getBestAppInRole: nil forExtension: extension] != nil)
|
||||
&& [self getBestAppInRole: nil forExtension: extension] != nil)
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
@ -2377,7 +2377,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
|
||||
/*
|
||||
* If the requested role is 'nil', we can accept an app that is either
|
||||
* an Editor (preferred) or a Viewer.
|
||||
* an Editor (preferred) or a Viewer, or unknown.
|
||||
*/
|
||||
while ((appName = [enumerator nextObject]) != nil)
|
||||
{
|
||||
|
@ -2385,15 +2385,10 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
|
||||
info = [apps objectForKey: appName];
|
||||
str = [info objectForKey: @"NSRole"];
|
||||
if (str == nil || [str isEqualToString: @"Editor"])
|
||||
{
|
||||
if (app != 0)
|
||||
{
|
||||
*app = appName;
|
||||
}
|
||||
return YES;
|
||||
}
|
||||
else if ([str isEqualToString: @"Viewer"])
|
||||
if (str == nil
|
||||
|| [str isEqualToString: @"Editor"]
|
||||
|| [str isEqualToString: @"Viewer"]
|
||||
|| [str isEqualToString: @""])
|
||||
{
|
||||
if (app != 0)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue