Commit ec317767 authored by sullivan's avatar sullivan
Browse files

WebKit:

	- WebKit part of fix for 3028061 -- visiting a bookmarked site
	that now has a site icon will not update bookmark's icon

	No longer store the icon in the WebHistoryItem, since there's no
	mechanism for keeping it fresh and telling interested clients
	when it changes. Instead, the latest icon is always returned from
	the icon database, and it's up to clients to get a fresh one when
	they notice that the icon for a URL has been updated.

        Reviewed by Darin

        * History.subproj/WebHistoryItem.h:
	remove _icon and _loadedIcon ivars

        * History.subproj/WebHistoryItem.m:
        (-[WebHistoryItem dealloc]):
	don't release _icon
        (-[WebHistoryItem icon]):
	just return fresh icon from database, don't store
        (-[WebHistoryItem setURL:]):
	don't set _loadedIcon to NO

WebBrowser:

	- WebBrowser part of fix for 3028061 -- visiting a bookmarked site
	that now has a site icon will not update bookmark's icon

	This first cut, which fixes the bug completely, just tosses out
	the cached bookmark & history menus & tells the outline view to
	redisplay everything. We might improve this later, but in practice
	the only difference in behavior that this will cause is to make
	the Bookmarks menu rebuild itself from scratch when clicked on
	more often. (We can address that multiple ways, probably the best
	one being to make rebuilding much faster by using IconRefs instead
	of NSImages, see 3120678.)

        Reviewed by Darin

        * BookmarksController.m:
        (-[BookmarksController awakeFromNib]):
	register for icon-changed notifications
        (-[BookmarksController _receivedIconChangedNotification:]):
	mark menu dirty when any icon has changed

        * BookmarksViewController.m:
        (-[BookmarksViewController awakeFromNib]):
	register for icon-changed notifications
        (-[BookmarksViewController iconChanged:]):
	reload outlineview data when any icon has changed. Note that this
	has no effect when the outlineview is not showing.

        * GlobalHistory.m:
        (-[GlobalHistory _registerForHistoryNotifications]):
	register for icon-changed notifications
        (-[GlobalHistory receivedIconChangedNotification:]):
	mark menu dirty when any icon has changed
        (-[GlobalHistory receivedEntriesChangedNotification:]):
	removed wayward space character


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3044 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 40247af4
2002-12-13 John Sullivan <sullivan@apple.com>
- WebKit part of fix for 3028061 -- visiting a bookmarked site
that now has a site icon will not update bookmark's icon
No longer store the icon in the WebHistoryItem, since there's no
mechanism for keeping it fresh and telling interested clients
when it changes. Instead, the latest icon is always returned from
the icon database, and it's up to clients to get a fresh one when
they notice that the icon for a URL has been updated.
Reviewed by Darin
* History.subproj/WebHistoryItem.h:
remove _icon and _loadedIcon ivars
* History.subproj/WebHistoryItem.m:
(-[WebHistoryItem dealloc]):
don't release _icon
(-[WebHistoryItem icon]):
just return fresh icon from database, don't store
(-[WebHistoryItem setURL:]):
don't set _loadedIcon to NO
=== Alexander-37u1 ===
2002-12-13 Darin Adler <darin@apple.com>
......
......@@ -18,14 +18,12 @@
NSString *_parent;
NSString *_title;
NSString *_displayTitle;
NSImage *_icon;
NSCalendarDate *_lastVisitedDate;
NSPoint _scrollPoint;
NSString *anchor;
NSArray *_documentState;
NSMutableArray *_subItems;
NSMutableDictionary *pageCache;
BOOL _loadedIcon;
BOOL _isTargetItem;
BOOL _alwaysAttemptToUsePageCache;
// info used to repost form data
......
......@@ -74,7 +74,6 @@ - (void)dealloc
[_parent release];
[_title release];
[_displayTitle release];
[_icon release];
[_lastVisitedDate release];
[anchor release];
[_documentState release];
......@@ -125,22 +124,11 @@ - (NSString *)displayTitle;
return _displayTitle;
}
- (void)_setIcon:(NSImage *)newIcon
{
[newIcon retain];
[_icon release];
_icon = newIcon;
}
- (NSImage *)icon
{
if (!_loadedIcon) {
NSImage *newIcon = [[WebIconDatabase sharedIconDatabase] iconForSiteURL:[self URL] withSize:WebIconSmallSize];
[self _setIcon:newIcon];
_loadedIcon = YES;
}
return _icon;
// Always get fresh icon from database. It's a client's responsibility to watch
// for updates to the database if desired.
return [[WebIconDatabase sharedIconDatabase] iconForSiteURL:[self URL] withSize:WebIconSmallSize];
}
......@@ -156,7 +144,6 @@ - (void)setURL:(NSURL *)URL
[self _retainIconInDatabase:NO];
[_URLString release];
_URLString = [string copy];
_loadedIcon = NO;
[self _retainIconInDatabase:YES];
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment