summaryrefslogtreecommitdiff
path: root/ui/osx_dock.mm
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:48 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:23:48 +0200
commitee1c8c5c25d25dfa42120125a8a45dc9831ee412 (patch)
tree67aa287157db954e0cadeee05b4aad331eb2ecf2 /ui/osx_dock.mm
parent5.13 (diff)
downloadFreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.gz
FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.tar.bz2
FreeFileSync-ee1c8c5c25d25dfa42120125a8a45dc9831ee412.zip
5.14
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