From 6d190c38f4c42f8f16200dc6836d995e2e461ba4 Mon Sep 17 00:00:00 2001
From: rfm
See Also: -applicationIconImage
- (NSDictionary*) _notificationUserInfo { + NSString *path; + NSString *port; NSNumber *processIdentifier; NSDictionary *userInfo; processIdentifier = [NSNumber numberWithInt: [[NSProcessInfo processInfo] processIdentifier]]; - userInfo = [NSDictionary dictionaryWithObjectsAndKeys: - [(GSServicesManager*)_listener port], @"NSApplicationName", - [[NSBundle mainBundle] bundlePath], @"NSApplicationPath", - processIdentifier, @"NSApplicationProcessIdentifier", - nil]; + port = [(GSServicesManager*)_listener port]; + path = [[NSBundle mainBundle] bundlePath]; + if (port == nil) + { + if (path == nil) + { + userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + processIdentifier, @"NSApplicationProcessIdentifier", + nil]; + } + else + { + userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + path, @"NSApplicationPath", + processIdentifier, @"NSApplicationProcessIdentifier", + nil]; + } + } + else if (path == nil) + { + userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + port, @"NSApplicationName", + processIdentifier, @"NSApplicationProcessIdentifier", + nil]; + } + else + { + userInfo = [NSDictionary dictionaryWithObjectsAndKeys: + port, @"NSApplicationName", + path, @"NSApplicationPath", + processIdentifier, @"NSApplicationProcessIdentifier", + nil]; + } return userInfo; }