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.
git-svn-id: svn://10.0.0.236/trunk@182567 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user