Simplify formatting

This commit is contained in:
Zhuo Lu 2018-01-16 18:59:58 -08:00
parent 31baafab3b
commit 1e1087abbb

View file

@ -29,13 +29,12 @@ CocoaNotification::~CocoaNotification() {
void CocoaNotification::Show(const NotificationOptions& options) { void CocoaNotification::Show(const NotificationOptions& options) {
notification_.reset([[NSUserNotification alloc] init]); notification_.reset([[NSUserNotification alloc] init]);
NSString* identifier = [NSString stringWithFormat:@"%s%d", "ElectronNotification", g_identifier_]; NSString* identifier = [NSString stringWithFormat:@"ElectronNotification%d", g_identifier_++];
[notification_ setTitle:base::SysUTF16ToNSString(options.title)]; [notification_ setTitle:base::SysUTF16ToNSString(options.title)];
[notification_ setSubtitle:base::SysUTF16ToNSString(options.subtitle)]; [notification_ setSubtitle:base::SysUTF16ToNSString(options.subtitle)];
[notification_ setInformativeText:base::SysUTF16ToNSString(options.msg)]; [notification_ setInformativeText:base::SysUTF16ToNSString(options.msg)];
[notification_ setIdentifier:identifier]; [notification_ setIdentifier:identifier];
g_identifier_++;
if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) { if (getenv("ELECTRON_DEBUG_NOTIFICATIONS")) {
LOG(INFO) << "Notification created (" << [identifier UTF8String] << ")"; LOG(INFO) << "Notification created (" << [identifier UTF8String] << ")";