Fix #118: Restore GrowlSafari's ability to reveal downloaded files in the Finder upon notification click.
authorPeter Hosey <hg@boredzo.org>
Sun Apr 18 00:05:31 2010 -0700 (2010-04-18)
changeset 4612d34cd7d301f5
parent 4611 678d4e7e792a
child 4613 9bf3d74dc04f
Fix #118: Restore GrowlSafari's ability to reveal downloaded files in the Finder upon notification click.
Extras/GrowlSafari/GrowlSafari.m
     1.1 --- a/Extras/GrowlSafari/GrowlSafari.m	Thu Apr 08 00:33:59 2010 -0700
     1.2 +++ b/Extras/GrowlSafari/GrowlSafari.m	Sun Apr 18 00:05:31 2010 -0700
     1.3 @@ -255,9 +255,12 @@
     1.4  }
     1.5  
     1.6  + (void) growlNotificationWasClicked:(id)clickContext {
     1.7 -	NSURL *url = [[NSURL alloc] initWithString:clickContext];
     1.8 -	[[NSWorkspace sharedWorkspace] openURL:url];
     1.9 -	[url release];
    1.10 +	NSURL *URL = [NSURL URLWithString:clickContext];
    1.11 +	if ([[URL scheme] isEqualToString:@"file"]) {
    1.12 +		[[NSWorkspace sharedWorkspace] selectFile:[URL path] inFileViewerRootedAtPath:@""];
    1.13 +	} else {
    1.14 +		[[NSWorkspace sharedWorkspace] openURL:URL];
    1.15 +	}
    1.16  }
    1.17  
    1.18  + (void) notifyRSSUpdate:(id)bookmark newEntries:(int)newEntries {
    1.19 @@ -339,7 +342,7 @@
    1.20  										   iconData:nil
    1.21  										   priority:0
    1.22  										   isSticky:NO
    1.23 -									   clickContext:nil];
    1.24 +									   clickContext:[[NSURL fileURLWithPath:[self currentPath]] absoluteString]];
    1.25  			[description release];
    1.26  		}
    1.27  	} else if (stage == GrowlSafariDownloadStageActive) {