diff options
Diffstat (limited to 'lib/osx_file_icon.mm')
-rw-r--r-- | lib/osx_file_icon.mm | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lib/osx_file_icon.mm b/lib/osx_file_icon.mm index 11fb053f..4db6642a 100644 --- a/lib/osx_file_icon.mm +++ b/lib/osx_file_icon.mm @@ -11,7 +11,7 @@ namespace { -osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw OsxError; NSException? +osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw SysError; NSException? { /* wxBitmap(NSImage*) is not good enough: it calls "[NSBitmapImageRep imageRepWithData:[img TIFFRepresentation]]" @@ -93,53 +93,53 @@ osx::ImageData extractBytes(NSImage* nsImg, int requestedSize) //throw OsxError; } -osx::ImageData osx::getThumbnail(const char* filename, int requestedSize) //throw OsxError +osx::ImageData osx::getThumbnail(const char* filename, int requestedSize) //throw SysError { @try { @autoreleasepool { NSString* nsFile = [NSString stringWithCString:filename encoding:NSUTF8StringEncoding]; - ZEN_OSX_ASSERT(nsFile != nil); //throw OsxError; can this fail? not documented + ZEN_OSX_ASSERT(nsFile != nil); //throw SysError; can this fail? not documented //stringWithCString returns string which is already set to autorelease! NSImage* nsImg = [[[NSImage alloc] initWithContentsOfFile:nsFile] autorelease]; ZEN_OSX_ASSERT(nsImg != nil); //may fail - return extractBytes(nsImg, requestedSize); //throw OsxError + return extractBytes(nsImg, requestedSize); //throw SysError } } - @catch (NSException* e) + @catch(NSException* e) { - throwOsxError(e); //throw OsxError + throwSysError(e); //throw SysError } } -osx::ImageData osx::getFileIcon(const char* filename, int requestedSize) //throw OsxError +osx::ImageData osx::getFileIcon(const char* filename, int requestedSize) //throw SysError { @try { @autoreleasepool { NSString* nsFile = [NSString stringWithCString:filename encoding:NSUTF8StringEncoding]; - ZEN_OSX_ASSERT(nsFile != nil); //throw OsxError; can this fail? not documented + ZEN_OSX_ASSERT(nsFile != nil); //throw SysError; can this fail? not documented //stringWithCString returns string which is already set to autorelease! NSImage* nsImg = [[NSWorkspace sharedWorkspace] iconForFile:nsFile]; ZEN_OSX_ASSERT(nsImg != nil); //can this fail? not documented - return extractBytes(nsImg, requestedSize); //throw OsxError + return extractBytes(nsImg, requestedSize); //throw SysError } } @catch (NSException* e) { - throwOsxError(e); //throw OsxError + throwSysError(e); //throw SysError } } -osx::ImageData osx::getDefaultFileIcon(int requestedSize) //throw OsxError +osx::ImageData osx::getDefaultFileIcon(int requestedSize) //throw SysError { @try { @@ -149,17 +149,17 @@ osx::ImageData osx::getDefaultFileIcon(int requestedSize) //throw OsxError //NSImage* nsImg = [[NSWorkspace sharedWorkspace] iconForFileType:@"dat"]; ZEN_OSX_ASSERT(nsImg != nil); //can this fail? not documented - return extractBytes(nsImg, requestedSize); //throw OsxError + return extractBytes(nsImg, requestedSize); //throw SysError } } @catch (NSException* e) { - throwOsxError(e); //throw OsxError + throwSysError(e); //throw SysError } } -osx::ImageData osx::getDefaultFolderIcon(int requestedSize) //throw OsxError +osx::ImageData osx::getDefaultFolderIcon(int requestedSize) //throw SysError { @try { @@ -169,11 +169,11 @@ osx::ImageData osx::getDefaultFolderIcon(int requestedSize) //throw OsxError //NSImage* nsImg = [[NSWorkspace sharedWorkspace] iconForFileType:NSFileTypeForHFSTypeCode(kGenericFolderIcon)]; ZEN_OSX_ASSERT(nsImg != nil); //may fail - return extractBytes(nsImg, requestedSize); //throw OsxError + return extractBytes(nsImg, requestedSize); //throw SysError } } @catch (NSException* e) { - throwOsxError(e); //throw OsxError + throwSysError(e); //throw SysError } } |