mirror of
https://github.com/transmission/transmission
synced 2024-12-25 17:17:31 +00:00
prefer favicon.png over favicon.ico
This commit is contained in:
parent
39515ea28b
commit
0fa3285a88
1 changed files with 4 additions and 4 deletions
|
@ -224,18 +224,18 @@ NSMutableSet * fTrackerIconLoading;
|
|||
{
|
||||
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
//try favicon.ico
|
||||
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
|
||||
//try favicon.png
|
||||
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
|
||||
|
||||
NSURLRequest * request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 30.0];
|
||||
NSData * iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
|
||||
NSImage * icon = [[NSImage alloc] initWithData: iconData];
|
||||
|
||||
//try favicon.png
|
||||
//try favicon.ico
|
||||
if (!icon)
|
||||
{
|
||||
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
|
||||
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
|
||||
|
||||
request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||
timeoutInterval: 30.0];
|
||||
|
|
Loading…
Reference in a new issue