Changeset 10471


Ignore:
Timestamp:
Apr 12, 2010, 2:55:50 AM (12 years ago)
Author:
livings124
Message:

#3133 Inspector > Trackers: Look for favicon.png

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TrackerCell.m

    r10069 r10471  
    225225    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    226226   
     227    //try favicon.ico
    227228    NSURL * favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.ico"]];
    228229   
     
    232233    NSImage * icon = [[NSImage alloc] initWithData: iconData];
    233234   
     235    //try favicon.png
     236    if (!icon)
     237    {
     238        favIconUrl = [NSURL URLWithString: [baseAddress stringByAppendingPathComponent: @"favicon.png"]];
     239       
     240        request = [NSURLRequest requestWithURL: favIconUrl cachePolicy: NSURLRequestUseProtocolCachePolicy
     241                    timeoutInterval: 30.0];
     242        iconData = [NSURLConnection sendSynchronousRequest: request returningResponse: NULL error: NULL];
     243        icon = [[NSImage alloc] initWithData: iconData];
     244    }
     245   
    234246    if (icon)
    235247    {
Note: See TracChangeset for help on using the changeset viewer.