Extras/growlnotify/main.m
changeset 4174 c5aea4e41bce
parent 4145 5f49950abfbb
child 4201 4ec29a49a1cb
     1.1 --- a/Extras/growlnotify/main.m	Wed Jul 09 21:35:04 2008 +0000
     1.2 +++ b/Extras/growlnotify/main.m	Sat Feb 28 19:10:16 2009 -0800
     1.3 @@ -296,16 +296,22 @@
     1.4  	} else if (appIcon) {
     1.5  		// get icon data for application name
     1.6  		CFStringRef app = CFStringCreateWithCString(kCFAllocatorDefault, appIcon, kCFStringEncodingUTF8);
     1.7 -		NSURL *appURL = [NSURL fileURLWithPath:[[NSWorkspace sharedWorkspace] fullPathForApplication:(NSString *)app]];
     1.8 -		if (appURL) {
     1.9 -			icon = (CFDataRef)copyIconDataForURL(appURL);
    1.10 +		NSString *appPath = [[NSWorkspace sharedWorkspace] fullPathForApplication:(NSString *)app];
    1.11 +		if (appPath) {
    1.12 +			NSURL *appURL = [NSURL fileURLWithPath:appPath];
    1.13 +			if (appURL) {
    1.14 +				icon = (CFDataRef)copyIconDataForURL(appURL);
    1.15 +			}
    1.16  		}
    1.17  		CFRelease(app);
    1.18  	}
    1.19  	if (!icon) {
    1.20 -		NSURL *appURL = [NSURL fileURLWithPath:[[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.apple.Terminal"]];
    1.21 -		if (appURL) {
    1.22 -			icon = (CFDataRef)copyIconDataForURL((NSURL *)appURL);
    1.23 +		NSString *appPath = [[NSWorkspace sharedWorkspace] absolutePathForAppBundleWithIdentifier:@"com.apple.Terminal"];
    1.24 +		if (appPath) {
    1.25 +			NSURL *appURL = [NSURL fileURLWithPath:appPath];
    1.26 +			if (appURL) {
    1.27 +				icon = (CFDataRef)copyIconDataForURL((NSURL *)appURL);
    1.28 +			}
    1.29  		}
    1.30  	}
    1.31