diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:24:59 +0200 |
commit | a1c91f4695e208d5a8f80dc37b1818169b7829ff (patch) | |
tree | 52f5134376d17c99b6c9e53133a2eb5cf171377c /lib/osx_file_icon.mm | |
parent | 5.16 (diff) | |
download | FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.gz FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.tar.bz2 FreeFileSync-a1c91f4695e208d5a8f80dc37b1818169b7829ff.zip |
5.17
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 } } |