mirror of
https://github.com/transmission/transmission
synced 2024-12-27 18:18:10 +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];
|
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
|
||||||
|
|
||||||
//try favicon.ico
|
//try favicon.png
|
||||||
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
|
NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
|
||||||
|
|
||||||
NSURLRequest * request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
NSURLRequest * request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||||
timeoutInterval: 30.0];
|
timeoutInterval: 30.0];
|
||||||
NSData * iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
|
NSData * iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
|
||||||
NSImage * icon = [[NSImage alloc] initWithData: iconData];
|
NSImage * icon = [[NSImage alloc] initWithData: iconData];
|
||||||
|
|
||||||
//try favicon.png
|
//try favicon.ico
|
||||||
if (!icon)
|
if (!icon)
|
||||||
{
|
{
|
||||||
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
|
favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
|
||||||
|
|
||||||
request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
|
||||||
timeoutInterval: 30.0];
|
timeoutInterval: 30.0];
|
||||||
|
|
Loading…
Reference in a new issue