Minor tidyup

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17987 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
CaS 2003-10-28 10:19:51 +00:00
parent 919b2b10a0
commit 117ed3210e
2 changed files with 34 additions and 20 deletions

View file

@ -1,3 +1,8 @@
2003-10-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/GSServicesManager.m: Tidy last patch to match use of
whitespace etc in GNUstep code.
2003-10-26 15:18 Alexander Malmberg <alexander@malmberg.org> 2003-10-26 15:18 Alexander Malmberg <alexander@malmberg.org>
Matt Rice <ratmice@yahoo.com> Matt Rice <ratmice@yahoo.com>
@ -33,7 +38,7 @@
2003-10-24 Richard Frith-Macdonald <rfm@gnu.org> 2003-10-24 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSWorkspace.m: Change a few uses of '/' in stgrings to * Source/NSWorkspace.m: Change a few uses of '/' in strings to
use stringByAppendingPatchComponent: use stringByAppendingPatchComponent:
* Tools/gopen.m: Fix to pass the full path of the file to the * Tools/gopen.m: Fix to pass the full path of the file to the
app being used to open it, so relative paths in the arguments app being used to open it, so relative paths in the arguments

View file

@ -1379,31 +1379,40 @@ GSContactApplication(NSString *appName, NSString *port, NSDate *expire)
NSDictionary * NSDictionary *
_serviceFromAnyLocalizedTitle(NSString *title) _serviceFromAnyLocalizedTitle(NSString *title)
{ {
NSDictionary *allServices; NSDictionary *allServices;
NSEnumerator *e1; NSEnumerator *e1;
NSDictionary *service; NSDictionary *service;
allServices = [manager menuServices]; allServices = [manager menuServices];
if(allServices == nil) if (allServices == nil)
return nil;
if([allServices objectForKey: title] != nil)
return [allServices objectForKey: title];
e1 = [allServices objectEnumerator];
while((service = [e1 nextObject]))
{ {
NSDictionary *menuItems; return nil;
NSString *itemName; }
NSEnumerator *e2;
if ([allServices objectForKey: title] != nil)
{
return [allServices objectForKey: title];
}
e1 = [allServices objectEnumerator];
while ((service = [e1 nextObject]) != nil)
{
NSDictionary *menuItems;
NSString *itemName;
NSEnumerator *e2;
menuItems = [service objectForKey: @"NSMenuItem"]; menuItems = [service objectForKey: @"NSMenuItem"];
if(menuItems == nil) if (menuItems == nil)
continue; {
continue;
}
e2 = [menuItems objectEnumerator]; e2 = [menuItems objectEnumerator];
while((itemName = [e2 nextObject])) while ((itemName = [e2 nextObject]) != nil)
if([itemName isEqualToString: title]) {
return service; if ([itemName isEqualToString: title] == YES)
{
return service;
}
}
} }
return nil; return nil;