Fix bug 293147: when copying a bookmarks folder, don't propagate the dock menu flag. Patch by englabenny@macnytt.com.

This commit is contained in:
smfr%smfr.org 2005-06-24 02:30:03 +00:00
Родитель 94a32617e9
Коммит 2850153499
1 изменённых файлов: 9 добавлений и 5 удалений

Просмотреть файл

@ -92,20 +92,24 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
{ {
if ([self isSmartFolder]) if ([self isSmartFolder])
return nil; return nil;
id doppleganger = [super copyWithZone:zone];
[doppleganger setSpecialFlag:[self specialFlag]]; id folderCopy = [super copyWithZone:zone];
unsigned folderFlags = ([self specialFlag] & ~kBookmarkDockMenuFolder); // don't copy dock menu flag
[folderCopy setSpecialFlag:folderFlags];
NSEnumerator *enumerator = [[self childArray] objectEnumerator]; NSEnumerator *enumerator = [[self childArray] objectEnumerator];
id anItem, aCopiedItem; id anItem, aCopiedItem;
//head fake the undomanager // head fake the undomanager
NSUndoManager *undoManager = [[BookmarkManager sharedBookmarkManager] undoManager]; NSUndoManager *undoManager = [[BookmarkManager sharedBookmarkManager] undoManager];
[undoManager disableUndoRegistration]; [undoManager disableUndoRegistration];
while ((anItem = [enumerator nextObject])) { while ((anItem = [enumerator nextObject])) {
aCopiedItem = [anItem copyWithZone:[anItem zone]]; aCopiedItem = [anItem copyWithZone:[anItem zone]];
[doppleganger insertChild:aCopiedItem]; [folderCopy insertChild:aCopiedItem];
[aCopiedItem release]; [aCopiedItem release];
} }
[undoManager enableUndoRegistration]; [undoManager enableUndoRegistration];
return doppleganger;
return folderCopy;
} }
-(void)dealloc -(void)dealloc