diff options
Diffstat (limited to 'Slimber/Cocoa')
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.h | 4 | ||||
-rw-r--r-- | Slimber/Cocoa/CocoaMenulet.mm | 14 |
2 files changed, 8 insertions, 10 deletions
diff --git a/Slimber/Cocoa/CocoaMenulet.h b/Slimber/Cocoa/CocoaMenulet.h index 292c8b9..7f2758b 100644 --- a/Slimber/Cocoa/CocoaMenulet.h +++ b/Slimber/Cocoa/CocoaMenulet.h @@ -18,9 +18,9 @@ class CocoaMenulet : public Menulet { private: virtual void clear(); - virtual void addItem(const Swift::String& name, const Swift::String& icon); + virtual void addItem(const std::string& name, const std::string& icon); virtual void addSeparator(); - void setIcon(const Swift::String& icon); + void setIcon(const std::string& icon); virtual void addAboutItem(); virtual void addRestartItem(); virtual void addExitItem(); diff --git a/Slimber/Cocoa/CocoaMenulet.mm b/Slimber/Cocoa/CocoaMenulet.mm index 90e699f..de9e9e9 100644 --- a/Slimber/Cocoa/CocoaMenulet.mm +++ b/Slimber/Cocoa/CocoaMenulet.mm @@ -4,8 +4,6 @@ #include <boost/function.hpp> -using namespace Swift; - CocoaMenulet::CocoaMenulet() { restartAction = [[CocoaAction alloc] initWithFunction: new boost::function<void()>(boost::ref(onRestartClicked))]; @@ -25,9 +23,9 @@ CocoaMenulet::~CocoaMenulet() { [restartAction release]; } -void CocoaMenulet::setIcon(const String& icon) { +void CocoaMenulet::setIcon(const std::string& icon) { NSString* path = [[NSBundle mainBundle] pathForResource: - [NSString stringWithUTF8String: icon.getUTF8Data()] ofType:@"png"]; + [NSString stringWithUTF8String: icon.c_str()] ofType:@"png"]; NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; [statusItem setImage: image]; [image release]; @@ -39,13 +37,13 @@ void CocoaMenulet::clear() { } } -void CocoaMenulet::addItem(const Swift::String& name, const String& icon) { +void CocoaMenulet::addItem(const std::string& name, const std::string& icon) { NSMenuItem* item = [[NSMenuItem alloc] initWithTitle: - [NSString stringWithUTF8String: name.getUTF8Data()] + [NSString stringWithUTF8String: name.c_str()] action: NULL keyEquivalent: @""]; - if (!icon.isEmpty()) { + if (!icon.empty()) { NSString* path = [[NSBundle mainBundle] pathForResource: - [NSString stringWithUTF8String: icon.getUTF8Data()] ofType:@"png"]; + [NSString stringWithUTF8String: icon.c_str()] ofType:@"png"]; NSImage* image = [[NSImage alloc] initWithContentsOfFile: path]; [item setImage: [[NSImage alloc] initWithContentsOfFile: path]]; [image release]; |