mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 06:20:47 +00:00
2004-10-30 Alex Perez <aperez@student.santarosa.edu>
* Headers/AppKit/NSImage.h (+_standardImageWithName:): New method. * Source/NSImage.m (+_standardImageWithName:): New method. * Source/NSWorkspace.m (_getImageForName:alternate:): Remove. Update callers to use +_standardImageWithName: instead. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@20270 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
db4b14985e
commit
703173d8c5
4 changed files with 33 additions and 30 deletions
|
@ -175,14 +175,11 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
|
|||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@interface NSWorkspace (Private)
|
||||
|
||||
// Icon handling
|
||||
- (NSImage*) _extIconForApp: (NSString*)appName info: (NSDictionary*)extInfo;
|
||||
- (NSImage*) _getImageWithName: (NSString*)name
|
||||
alternate: (NSString*)alternate;
|
||||
- (NSImage*) unknownFiletypeImage;
|
||||
- (NSImage*) _saveImageFor: (NSString*)iconPath;
|
||||
- (NSString*) thumbnailForFile: (NSString *)file;
|
||||
|
@ -853,9 +850,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
if (rootImage == nil)
|
||||
{
|
||||
rootImage = RETAIN([self _getImageWithName:
|
||||
@"Root_PC.tiff"
|
||||
alternate: @"common_Root_PC.tiff"]);
|
||||
rootImage = RETAIN([NSImage _standardImageWithName:
|
||||
@"Root_PC.tiff"]);
|
||||
}
|
||||
|
||||
image = rootImage;
|
||||
|
@ -864,9 +860,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
if (homeImage == nil)
|
||||
{
|
||||
homeImage = RETAIN([self _getImageWithName:
|
||||
@"HomeDirectory.tiff"
|
||||
alternate: @"common_HomeDirectory.tiff"]);
|
||||
homeImage = RETAIN([NSImage _standardImageWithName:
|
||||
@"HomeDirectory.tiff"]);
|
||||
}
|
||||
image = homeImage;
|
||||
}
|
||||
|
@ -874,8 +869,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
if (folderImage == nil)
|
||||
{
|
||||
folderImage = RETAIN([self _getImageWithName:
|
||||
@"Folder.tiff" alternate: @"common_Folder.tiff"]);
|
||||
folderImage = RETAIN([NSImage _standardImageWithName:
|
||||
@"Folder.tiff"]);
|
||||
}
|
||||
image = folderImage;
|
||||
}
|
||||
|
@ -916,9 +911,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
if (unknownTool == nil)
|
||||
{
|
||||
unknownTool = RETAIN([self _getImageWithName:
|
||||
@"UnknownTool.tiff" alternate:
|
||||
@"common_UnknownTool.tiff"]);
|
||||
unknownTool = RETAIN([NSImage _standardImageWithName:
|
||||
@"UnknownTool.tiff"]);
|
||||
}
|
||||
image = unknownTool;
|
||||
}
|
||||
|
@ -1679,17 +1673,6 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
return nil;
|
||||
}
|
||||
|
||||
- (NSImage*) _getImageWithName: (NSString*)name
|
||||
alternate: (NSString*)alternate
|
||||
{
|
||||
NSImage *image = nil;
|
||||
|
||||
image = [NSImage imageNamed: name];
|
||||
if (image == nil)
|
||||
image = [NSImage imageNamed: alternate];
|
||||
return image;
|
||||
}
|
||||
|
||||
/** Returns the default icon to display for a directory */
|
||||
- (NSImage*) unknownFiletypeImage
|
||||
{
|
||||
|
@ -1697,8 +1680,7 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
|
||||
if (image == nil)
|
||||
{
|
||||
image = RETAIN([self _getImageWithName: @"Unknown.tiff"
|
||||
alternate: @"common_Unknown.tiff"]);
|
||||
image = RETAIN([NSImage _standardImageWithName: @"Unknown.tiff"]);
|
||||
}
|
||||
|
||||
return image;
|
||||
|
@ -1830,9 +1812,8 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
|
|||
{
|
||||
if (unknownApplication == nil)
|
||||
{
|
||||
unknownApplication = RETAIN([self _getImageWithName:
|
||||
@"UnknownApplication.tiff" alternate:
|
||||
@"common_UnknownApplication.tiff"]);
|
||||
unknownApplication = RETAIN([NSImage _standardImageWithName:
|
||||
@"UnknownApplication.tiff"]);
|
||||
}
|
||||
icon = unknownApplication;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue