Skip to content

Commit

Permalink
Send the CFBundleGitVersion string along with the other sparkle profi…
Browse files Browse the repository at this point in the history
…le info
  • Loading branch information
brotherbard committed Nov 15, 2010
1 parent 515b66f commit 0807099
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ApplicationController.m
Expand Up @@ -64,6 +64,7 @@ - (void)registerServices
- (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 );
Expand Down Expand Up @@ -380,4 +381,29 @@ - (void) dealloc {
[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

0 comments on commit 0807099

Please sign in to comment.