diff options
author | Remko Tronçon <git@el-tramo.be> | 2011-02-14 18:57:18 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2011-02-14 21:36:32 (GMT) |
commit | cb05f5a908e20006c954ce38755c2e422ecc2388 (patch) | |
tree | a793551a5fe279a57d4330119560e8542f745484 /Slimber/Cocoa | |
parent | cad974b45c0fb9355e68d9728e42c9ae3dbcebc7 (diff) | |
download | swift-cb05f5a908e20006c954ce38755c2e422ecc2388.zip swift-cb05f5a908e20006c954ce38755c2e422ecc2388.tar.bz2 |
Removed Swift::String.
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]; |