Camino only - Bug 369042: Fix bookmark icon for missing files. r=smorgan sr=pink

This commit is contained in:
stridey%gmail.com 2007-02-09 17:52:38 +00:00
Родитель 73aca6d8bf
Коммит a845f6cc6f
2 изменённых файлов: 6 добавлений и 2 удалений

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

@ -234,6 +234,7 @@ NSString* const kPreviousSessionTerminatedNormallyKey = @"PreviousSessionTermina
// register some special favicon images
[[SiteIconProvider sharedFavoriteIconProvider] registerFaviconImage:[NSImage imageNamed:@"smallDocument"] forPageURI:@"about:blank"];
[[SiteIconProvider sharedFavoriteIconProvider] registerFaviconImage:[NSImage imageNamed:@"smallDocument"] forPageURI:@"about:local_file"];
[[SiteIconProvider sharedFavoriteIconProvider] registerFaviconImage:[NSImage imageNamed:@"bm_favicon"] forPageURI:@"about:bookmarks"];
[[SiteIconProvider sharedFavoriteIconProvider] registerFaviconImage:[NSImage imageNamed:@"historyicon"] forPageURI:@"about:history"];

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

@ -555,10 +555,13 @@ NeckoCacheHelper::ClearCache()
+ (NSString*)defaultFaviconLocationStringFromURI:(NSString*)inURI
{
// about: urls and local files are special
if ([inURI hasPrefix:@"about:"] || [inURI hasPrefix:@"file:"])
if ([inURI hasPrefix:@"about:"])
return inURI;
// If the file exists, return its path, otherwise use generic icon location
if ([inURI hasPrefix:@"file:"])
return ([[NSFileManager defaultManager] fileExistsAtPath:[[NSURL URLWithString:inURI] path]] ? inURI : @"about:local_file");
// we use nsIURI here, rather than NSURL, because the former does
// a better job with suspect urls (e.g. those containing |), and
// allows us go keep the port