Send the CFBundleGitVersion string along with the other sparkle profile info

This commit is contained in:
Nathan Kinsinger
2010-09-25 13:41:33 -06:00
parent 515b66f09a
commit 0807099dc3
+26
View File
@@ -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