Fix bug 312959: avoid hang showing tooltip on a newly added bookmark toolbar item by ensuring that the bookmark has its title and url before notifications are fired for it, and avoiding "\n\n" tooltip strings. r=mento.

This commit is contained in:
smfr%smfr.org 2005-10-20 02:03:20 +00:00
Родитель 10d9b28fce
Коммит d99cf2fe48
2 изменённых файлов: 9 добавлений и 4 удалений

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

@ -109,9 +109,14 @@
return;
}
[self setAction:@selector(openBookmark:)];
[self setToolTip:[NSString stringWithFormat:NSLocalizedString(@"BookmarkButtonTooltipFormat", @""),
NSString* tooltipString = [NSString stringWithFormat:NSLocalizedString(@"BookmarkButtonTooltipFormat", @""),
[bookmarkItem title],
[bookmarkItem url]]];
[bookmarkItem url]];
// using "\n\n" as a tooltip string causes Cocoa to hang when displaying the tooltip,
// so be paranoid about not doing that
if (![tooltipString isEqualToString:@"\n\n"])
[self setToolTip:tooltipString];
}
else {
[[self cell] setClickHoldTimeout:0.5];

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

@ -548,8 +548,6 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
{
if (![self isRoot]) {
Bookmark *theBookmark = [[Bookmark alloc] init];
[self insertChild:theBookmark atIndex:aPosition isMove:NO];
[theBookmark release];
[theBookmark setTitle:aTitle];
[theBookmark setKeyword:aKeyword];
[theBookmark setUrl:aURL];
@ -557,6 +555,8 @@ NSString* const BookmarkFolderDockMenuChangeNotificaton = @"bf_dmc";
[theBookmark setLastVisit:aDate];
[theBookmark setStatus:aStatus];
[theBookmark setIsSeparator:aSeparator];
[self insertChild:theBookmark atIndex:aPosition isMove:NO];
[theBookmark release];
return theBookmark;
}
return nil;