mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 19:00:47 +00:00
iFixup for error in last mod.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12185 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3809ca017e
commit
c09e7d743f
2 changed files with 36 additions and 21 deletions
|
@ -4,6 +4,8 @@
|
||||||
to -getBestApp... so that it picks the best available app rather
|
to -getBestApp... so that it picks the best available app rather
|
||||||
than just the one specifed by the user as 'best'. This means you can
|
than just the one specifed by the user as 'best'. This means you can
|
||||||
always use it to get an app even if the user has set no preference.
|
always use it to get an app even if the user has set no preference.
|
||||||
|
Fixed uninitialised variable in first version of this mod and made
|
||||||
|
user preferences override declared types opened by apps.
|
||||||
|
|
||||||
2002-01-21 Adam Fedor <fedor@gnu.org>
|
2002-01-21 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -178,8 +178,7 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
||||||
- (NSImage*) _iconForExtension: (NSString*)ext;
|
- (NSImage*) _iconForExtension: (NSString*)ext;
|
||||||
- (BOOL) _extension: (NSString*)ext
|
- (BOOL) _extension: (NSString*)ext
|
||||||
role: (NSString*)role
|
role: (NSString*)role
|
||||||
app: (NSString**)app
|
app: (NSString**)app;
|
||||||
andInfo: (NSDictionary**)inf;
|
|
||||||
|
|
||||||
// application communication
|
// application communication
|
||||||
- (BOOL) _launchApplication: (NSString *)appName
|
- (BOOL) _launchApplication: (NSString *)appName
|
||||||
|
@ -362,7 +361,7 @@ static NSString *_rootPath = @"/";
|
||||||
{
|
{
|
||||||
NSString *ext = [fullPath pathExtension];
|
NSString *ext = [fullPath pathExtension];
|
||||||
|
|
||||||
if ([self _extension: ext role: nil app: &appName andInfo: 0] == NO)
|
if ([self _extension: ext role: nil app: &appName] == NO)
|
||||||
{
|
{
|
||||||
NSWarnLog(@"No known applications for file extension '%@'", ext);
|
NSWarnLog(@"No known applications for file extension '%@'", ext);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -406,7 +405,7 @@ static NSString *_rootPath = @"/";
|
||||||
NSString *appName;
|
NSString *appName;
|
||||||
NSString *ext = [fullPath pathExtension];
|
NSString *ext = [fullPath pathExtension];
|
||||||
|
|
||||||
if ([self _extension: ext role: nil app: &appName andInfo: 0] == NO)
|
if ([self _extension: ext role: nil app: &appName] == NO)
|
||||||
{
|
{
|
||||||
NSWarnLog(@"No known applications for file extension '%@'", ext);
|
NSWarnLog(@"No known applications for file extension '%@'", ext);
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -1019,7 +1018,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
{
|
{
|
||||||
NSString *appName = nil;
|
NSString *appName = nil;
|
||||||
|
|
||||||
if ([self _extension: ext role: role app: &appName andInfo: 0] == NO)
|
if ([self _extension: ext role: role app: &appName] == NO)
|
||||||
{
|
{
|
||||||
appName = nil;
|
appName = nil;
|
||||||
}
|
}
|
||||||
|
@ -1432,11 +1431,10 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
- (BOOL) _extension: (NSString*)ext
|
- (BOOL) _extension: (NSString*)ext
|
||||||
role: (NSString*)role
|
role: (NSString*)role
|
||||||
app: (NSString**)app
|
app: (NSString**)app
|
||||||
andInfo: (NSDictionary**)inf
|
|
||||||
{
|
{
|
||||||
NSEnumerator *enumerator;
|
NSEnumerator *enumerator;
|
||||||
NSString *appName = nil;
|
NSString *appName = nil;
|
||||||
NSDictionary *apps;
|
NSDictionary *apps = [self infoForExtension: ext];
|
||||||
NSDictionary *prefs;
|
NSDictionary *prefs;
|
||||||
NSDictionary *info;
|
NSDictionary *info;
|
||||||
|
|
||||||
|
@ -1459,9 +1457,17 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
{
|
{
|
||||||
*app = appName;
|
*app = appName;
|
||||||
}
|
}
|
||||||
if (inf != 0)
|
return YES;
|
||||||
|
}
|
||||||
|
else if ([self locateApplicationBinary: appName] != nil)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Return the preferred application even though it doesn't
|
||||||
|
* say it opens this type of file ... preferences overrule.
|
||||||
|
*/
|
||||||
|
if (app != 0)
|
||||||
{
|
{
|
||||||
*inf = info;
|
*app = appName;
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -1479,9 +1485,17 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
{
|
{
|
||||||
*app = appName;
|
*app = appName;
|
||||||
}
|
}
|
||||||
if (inf != 0)
|
return YES;
|
||||||
|
}
|
||||||
|
else if ([self locateApplicationBinary: appName] != nil)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Return the preferred application even though it doesn't
|
||||||
|
* say it opens this type of file ... preferences overrule.
|
||||||
|
*/
|
||||||
|
if (app != 0)
|
||||||
{
|
{
|
||||||
*inf = info;
|
*app = appName;
|
||||||
}
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
@ -1495,7 +1509,6 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
* The 'NSRole' field specifies what the app can do with the file - if it
|
* The 'NSRole' field specifies what the app can do with the file - if it
|
||||||
* is missing, we assume an 'Editor' role.
|
* is missing, we assume an 'Editor' role.
|
||||||
*/
|
*/
|
||||||
apps = [self infoForExtension: ext];
|
|
||||||
if (apps == nil || [apps count] == 0)
|
if (apps == nil || [apps count] == 0)
|
||||||
{
|
{
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -1519,17 +1532,17 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
if (str == nil || [str isEqualToString: @"Editor"])
|
if (str == nil || [str isEqualToString: @"Editor"])
|
||||||
{
|
{
|
||||||
if (app != 0)
|
if (app != 0)
|
||||||
*app = appName;
|
{
|
||||||
if (inf != 0)
|
*app = appName;
|
||||||
*inf = info;
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
else if ([str isEqualToString: @"Viewer"])
|
else if ([str isEqualToString: @"Viewer"])
|
||||||
{
|
{
|
||||||
if (app != 0)
|
if (app != 0)
|
||||||
*app = appName;
|
{
|
||||||
if (inf != 0)
|
*app = appName;
|
||||||
*inf = info;
|
}
|
||||||
found = YES;
|
found = YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1547,9 +1560,9 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
|
||||||
|| [str isEqualToString: role])
|
|| [str isEqualToString: role])
|
||||||
{
|
{
|
||||||
if (app != 0)
|
if (app != 0)
|
||||||
*app = appName;
|
{
|
||||||
if (inf != 0)
|
*app = appName;
|
||||||
*inf = info;
|
}
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue