Ignore:
Timestamp:
Nov 11, 2006, 8:00:50 PM (16 years ago)
Author:
livings124
Message:

If the folder doesn't exist, still show a folder icon for the download/incomplete folder prefs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/ExpandedPathToIconTransformer.m

    r1037 r1078  
    1919        return nil;
    2020   
    21     NSImage * icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]];
     21    NSString * path = [value stringByExpandingTildeInPath];
     22    NSImage * icon;
     23    //show a folder icon if the folder doesn't exist
     24    if (![[NSFileManager defaultManager] fileExistsAtPath: path] && [[path pathExtension] isEqualToString: @""])
     25        icon = [[NSWorkspace sharedWorkspace] iconForFileType: NSFileTypeForHFSTypeCode('fldr')];
     26    else
     27        icon = [[NSWorkspace sharedWorkspace] iconForFile: [value stringByExpandingTildeInPath]];
     28   
    2229    [icon setScalesWhenResized: YES];
    2330    [icon setSize: NSMakeSize(16.0, 16.0)];
Note: See TracChangeset for help on using the changeset viewer.