Minor bugfix

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6529 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-04-28 19:35:42 +00:00
parent cfa34b3213
commit a6545d441b
2 changed files with 22 additions and 18 deletions

View file

@ -1,3 +1,7 @@
2000-04-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSWorkspace.m: Fixed bug setting preferred application/icon.
2000-04-27 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu> 2000-04-27 Jonathan Gapen <jagapen@whitewater.chem.wisc.edu>
* Headers/gnustep/gui/NSColorWell.h: Add ivar, prepend underscores. * Headers/gnustep/gui/NSColorWell.h: Add ivar, prepend underscores.

View file

@ -448,14 +448,14 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
if (role == nil || [role isEqualToString: @"Editor"]) if (role == nil || [role isEqualToString: @"Editor"])
{ {
appName = [prefs objectForKey: @"Editor"]; appName = [prefs objectForKey: @"Editor"];
if (appName) if (appName != nil)
{ {
info = [apps objectForKey: appName]; info = [apps objectForKey: appName];
if (info) if (info != nil)
{ {
if (app) if (app != 0)
*app = appName; *app = appName;
if (inf) if (inf != 0)
*inf = info; *inf = info;
return YES; return YES;
} }
@ -464,14 +464,14 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
if (role == nil || [role isEqualToString: @"Viewer"]) if (role == nil || [role isEqualToString: @"Viewer"])
{ {
appName = [prefs objectForKey: @"Viewer"]; appName = [prefs objectForKey: @"Viewer"];
if (appName) if (appName != nil)
{ {
info = [apps objectForKey: appName]; info = [apps objectForKey: appName];
if (info) if (info != nil)
{ {
if (app) if (app != 0)
*app = appName; *app = appName;
if (inf) if (inf != 0)
*inf = info; *inf = info;
return YES; return YES;
} }
@ -503,17 +503,17 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
str = [info objectForKey: @"NSRole"]; str = [info objectForKey: @"NSRole"];
if (str == nil || [str isEqualToString: @"Editor"]) if (str == nil || [str isEqualToString: @"Editor"])
{ {
if (app) if (app != 0)
*app = appName; *app = appName;
if (inf) if (inf != 0)
*inf = info; *inf = info;
return YES; return YES;
} }
else if ([str isEqualToString: @"Viewer"]) else if ([str isEqualToString: @"Viewer"])
{ {
if (app) if (app != 0)
*app = appName; *app = appName;
if (inf) if (inf != 0)
*inf = info; *inf = info;
found = YES; found = YES;
} }
@ -531,9 +531,9 @@ extIconForApp(NSWorkspace *ws, NSString *appName, NSDictionary *typeInfo)
if ((str == nil && [role isEqualToString: @"Editor"]) if ((str == nil && [role isEqualToString: @"Editor"])
|| [str isEqualToString: role]) || [str isEqualToString: role])
{ {
if (app) if (app != 0)
*app = appName; *app = appName;
if (inf) if (inf != 0)
*inf = info; *inf = info;
return YES; return YES;
} }
@ -1280,7 +1280,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
NSData *data; NSData *data;
ext = [ext lowercaseString]; ext = [ext lowercaseString];
if (extPreferences) if (extPreferences != nil)
map = [extPreferences mutableCopy]; map = [extPreferences mutableCopy];
else else
map = [NSMutableDictionary new]; map = [NSMutableDictionary new];
@ -1316,7 +1316,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
[map setObject: inf forKey: ext]; [map setObject: inf forKey: ext];
RELEASE(inf); RELEASE(inf);
RELEASE(extPreferences); RELEASE(extPreferences);
extPreferences = inf; extPreferences = map;
data = [NSSerializer serializePropertyList: extPreferences]; data = [NSSerializer serializePropertyList: extPreferences];
[data writeToFile: extPrefPath atomically: YES]; [data writeToFile: extPrefPath atomically: YES];
} }
@ -1328,7 +1328,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
NSData *data; NSData *data;
ext = [ext lowercaseString]; ext = [ext lowercaseString];
if (extPreferences) if (extPreferences != nil)
map = [extPreferences mutableCopy]; map = [extPreferences mutableCopy];
else else
map = [NSMutableDictionary new]; map = [NSMutableDictionary new];
@ -1343,7 +1343,7 @@ inFileViewerRootedAtPath: (NSString *)rootFullpath
[map setObject: inf forKey: ext]; [map setObject: inf forKey: ext];
RELEASE(inf); RELEASE(inf);
RELEASE(extPreferences); RELEASE(extPreferences);
extPreferences = inf; extPreferences = map;
data = [NSSerializer serializePropertyList: extPreferences]; data = [NSSerializer serializePropertyList: extPreferences];
[data writeToFile: extPrefPath atomically: YES]; [data writeToFile: extPrefPath atomically: YES];
} }