mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 23:31:02 +00:00
Fix handling of timestamps and removal of old menu items when updating services/services menu.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13855 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9f1fc9c153
commit
4151738496
2 changed files with 13 additions and 14 deletions
|
@ -1,3 +1,9 @@
|
|||
2002-06-12 Alexander Malmberg <alexander@malmberg.org>
|
||||
|
||||
* Source/GSServicesManager.m (-loadServices): Only update timestamp
|
||||
when the file has changed.
|
||||
(-rebuildServicesMenu): Correctly remove the old menu items.
|
||||
|
||||
Tue Jun 11 14:11:22 2002 Nicola Pero <n.pero@mi.flashnet.it>
|
||||
|
||||
Patch by Jeff Teunissen with changes by myself:
|
||||
|
|
|
@ -608,16 +608,15 @@ static NSString *disabledName = @".GNUstepDisabled";
|
|||
if (plist)
|
||||
{
|
||||
NSMutableSet *s;
|
||||
stamp = mod;
|
||||
changed = YES;
|
||||
s = (NSMutableSet*)[NSMutableSet setWithArray: plist];
|
||||
ASSIGN(_allDisabled, s);
|
||||
}
|
||||
}
|
||||
/* Track most recent version of file loaded */
|
||||
ASSIGN(_disabledStamp, mod);
|
||||
}
|
||||
}
|
||||
/* Track most recent version of file loaded or last time we checked */
|
||||
ASSIGN(_disabledStamp, stamp);
|
||||
|
||||
stamp = [NSDate date];
|
||||
if ([mgr fileExistsAtPath: _servicesPath])
|
||||
|
@ -640,15 +639,14 @@ static NSString *disabledName = @".GNUstepDisabled";
|
|||
mutableContainers: YES];
|
||||
if (plist)
|
||||
{
|
||||
stamp = mod;
|
||||
ASSIGN(_allServices, plist);
|
||||
changed = YES;
|
||||
}
|
||||
}
|
||||
/* Track most recent version of file loaded */
|
||||
ASSIGN(_servicesStamp, mod);
|
||||
}
|
||||
}
|
||||
/* Track most recent version of file loaded or last time we checked */
|
||||
ASSIGN(_servicesStamp, stamp);
|
||||
if (changed)
|
||||
{
|
||||
[self rebuildServices];
|
||||
|
@ -742,7 +740,6 @@ static NSString *disabledName = @".GNUstepDisabled";
|
|||
{
|
||||
if (_servicesMenu != nil)
|
||||
{
|
||||
NSArray *itemArray;
|
||||
NSMutableSet *keyEquivalents;
|
||||
unsigned pos;
|
||||
unsigned loc0;
|
||||
|
@ -750,13 +747,9 @@ static NSString *disabledName = @".GNUstepDisabled";
|
|||
SEL sel = @selector(doService:);
|
||||
NSMenu *submenu = nil;
|
||||
|
||||
itemArray = [[_servicesMenu itemArray] copy];
|
||||
pos = [itemArray count];
|
||||
while (pos > 0)
|
||||
{
|
||||
[_servicesMenu removeItem: [itemArray objectAtIndex: --pos]];
|
||||
}
|
||||
RELEASE(itemArray);
|
||||
pos = [_servicesMenu numberOfItems];
|
||||
for (; pos; pos--)
|
||||
[_servicesMenu removeItemAtIndex: 0];
|
||||
|
||||
keyEquivalents = [NSMutableSet setWithCapacity: 4];
|
||||
for (loc0 = pos = 0; pos < [_menuTitles count]; pos++)
|
||||
|
|
Loading…
Reference in a new issue