added support for home directory image

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13262 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-03-28 13:23:38 +00:00
parent 0ec9a3d014
commit 98d2bf055f

View file

@ -48,6 +48,7 @@
#include <AppKit/NSApplication.h>
#include <AppKit/NSImage.h>
#include <AppKit/NSView.h>
#include <AppKit/NSPanel.h>
#include <AppKit/NSWindow.h>
#include <AppKit/NSScreen.h>
#include <AppKit/GSServicesManager.h>
@ -174,6 +175,7 @@ static NSString *GSWorkspaceNotification = @"GSWorkspaceNotification";
- (NSImage*) _getImageWithName: (NSString*)name
alternate: (NSString*)alternate;
- (NSImage*) folderImage;
- (NSImage*) homeDirectoryImage;
- (NSImage*) unknownFiletypeImage;
- (NSImage*) rootImage;
- (NSImage*) _iconForExtension: (NSString*)ext;
@ -683,9 +685,17 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
if (image == nil || image == [self unknownFiletypeImage])
{
if ([aPath isEqual: _rootPath])
image = [self rootImage];
{
image = [self rootImage];
}
else if ([aPath isEqual: NSHomeDirectory ()])
{
image = [self homeDirectoryImage];
}
else
image = [self folderImage];
{
image = [self folderImage];
}
}
}
}
@ -1326,6 +1336,20 @@ inFileViewerRootedAtPath: (NSString*)rootFullpath
return image;
}
/** Returns the default icon to display for the user home directory */
- (NSImage*) homeDirectoryImage
{
static NSImage *image = nil;
if (image == nil)
{
image = RETAIN([self _getImageWithName: @"HomeDirectory.tiff"
alternate: @"common_HomeDirectory.tiff"]);
}
return image;
}
/** Returns the default icon to display for a directory */
- (NSImage*) unknownFiletypeImage
{