Skip to content

Commit 0807099

Browse files
committed
Send the CFBundleGitVersion string along with the other sparkle profile info
1 parent 515b66f commit 0807099

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

ApplicationController.m

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ - (void)registerServices
6464
- (void)applicationDidFinishLaunching:(NSNotification*)notification
6565
{
6666
[[SUUpdater sharedUpdater] setSendsSystemProfile:YES];
67+
[[SUUpdater sharedUpdater] setDelegate:self];
6768

6869
// Make sure Git's SSH password requests get forwarded to our little UI tool:
6970
setenv( "SSH_ASKPASS", [[[NSBundle mainBundle] pathForResource: @"gitx_askpasswd" ofType: @""] UTF8String], 1 );
@@ -380,4 +381,29 @@ - (void) dealloc {
380381
[managedObjectModel release], managedObjectModel = nil;
381382
[super dealloc];
382383
}
384+
385+
386+
#pragma mark Sparkle delegate methods
387+
388+
- (NSArray *)feedParametersForUpdater:(SUUpdater *)updater sendingSystemProfile:(BOOL)sendingProfile
389+
{
390+
NSArray *keys = [NSArray arrayWithObjects:@"key", @"displayKey", @"value", @"displayValue", nil];
391+
NSMutableArray *feedParameters = [NSMutableArray array];
392+
393+
// only add parameters if the profile is being sent this time
394+
if (sendingProfile) {
395+
NSString *CFBundleGitVersion = [[[NSBundle mainBundle] infoDictionary] valueForKey:@"CFBundleGitVersion"];
396+
if (CFBundleGitVersion)
397+
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"CFBundleGitVersion", @"Full Version", CFBundleGitVersion, CFBundleGitVersion, nil]
398+
forKeys:keys]];
399+
400+
NSString *gitVersion = [PBGitBinary version];
401+
if (gitVersion)
402+
[feedParameters addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"gitVersion", @"git Version", gitVersion, gitVersion, nil]
403+
forKeys:keys]];
404+
}
405+
406+
return feedParameters;
407+
}
408+
383409
@end

0 commit comments

Comments
 (0)