summaryrefslogtreecommitdiff
path: root/ui/osx_dock.mm
diff options
context:
space:
mode:
Diffstat (limited to 'ui/osx_dock.mm')
-rw-r--r--ui/osx_dock.mm25
1 files changed, 7 insertions, 18 deletions
diff --git a/ui/osx_dock.mm b/ui/osx_dock.mm
index 5ac6d154..a7161f60 100644
--- a/ui/osx_dock.mm
+++ b/ui/osx_dock.mm
@@ -5,31 +5,20 @@
// **************************************************************************
#include "osx_dock.h"
-#import <Cocoa/Cocoa.h>
+#include <zen/osx_throw_exception.h>
+#include <Cocoa/Cocoa.h>
-void osx::dockIconSetText(const char* str)
+void osx::dockIconSetText(const char* str) //throw OsxError
{
@try
{
- NSString* label = [NSString stringWithCString:str encoding:NSUTF8StringEncoding];
- [[NSApp dockTile] setBadgeLabel:label];
+ NSString* label = [NSString stringWithCString:str encoding:NSUTF8StringEncoding];
+ //stringWithCString returns string which is already set to autorelease!
+ [[NSApp dockTile] setBadgeLabel:label]; //label may be nil
}
@catch (NSException* e)
{
- std::string msg;
- if (const char* name = [[e name ] cStringUsingEncoding:NSUTF8StringEncoding])
- msg += name;
- if (const char* descr = [[e reason] cStringUsingEncoding:NSUTF8StringEncoding])
- {
- msg += "\n";
- msg += descr;
- }
- throw OsxError(msg);
- /*
- e.g.
- NSInvalidArgumentException
- *** +[NSString stringWithCString:encoding:]: NULL cString
- */
+ throwOsxError(e); //throw OsxError
}
}
bgstack15