зеркало из https://github.com/mozilla/pjs.git
Camino only - Bug 369042: Fix bookmark icon for missing files. r=smorgan sr=pink
This commit is contained in:
Родитель
73aca6d8bf
Коммит
a845f6cc6f
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче