diff --git a/ApplicationController.m b/ApplicationController.m index c73b524..3f6428f 100644 --- a/ApplicationController.m +++ b/ApplicationController.m @@ -64,6 +64,7 @@ - (void)applicationDidFinishLaunching:(NSNotification*)notification { [[SUUpdater sharedUpdater] setSendsSystemProfile:YES]; + [[SUUpdater sharedUpdater] setDelegate:self]; // Make sure Git's SSH password requests get forwarded to our little UI tool: setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 ); @@ -380,4 +381,29 @@ [managedObjectModel release], managedObjectModel = nil; [super dealloc]; } + + +#pragma mark Sparkle delegate methods + +- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile +{ + NSArray *keys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil]; + NSMutableArray *feedParameters = [NSMutableArray array]; + + // only add parameters if the profile is being sent this time + if (sendingProfile) { + NSString *CFBundleGitVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleGitVersion"]; + if (CFBundleGitVersion) + [feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"CFBundleGitVersion", @"Full Version", CFBundleGitVersion, CFBundleGitVersion, nil] + forKeys:keys]]; + + NSString *gitVersion = [PBGitBinary version]; + if (gitVersion) + [feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"gitVersion", @"git Version", gitVersion, gitVersion, nil] + forKeys:keys]]; + } + + return feedParameters; +} + @end