diff --git a/Feedback/FeedbackController.m b/Feedback/FeedbackController.m index bd4b1e31a..1db08beb5 100644 --- a/Feedback/FeedbackController.m +++ b/Feedback/FeedbackController.m @@ -65,8 +65,10 @@ //Using this so that if its a bad connection, it doesnt sit there looking stupid..or should it feedbackSocket = [[FeedbackSocket alloc] init]; [feedbackSocket setDelegate:self]; + + NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"]; - [feedbackSocket sendFeedback:[fromView stringValue] subject:[subjectView stringValue] message:[messageView string]]; + [feedbackSocket sendFeedback:[fromView stringValue] subject:[subjectView stringValue] message:[messageView string] version:version]; } - (IBAction)cancel:(id)sender diff --git a/Feedback/FeedbackSocket.h b/Feedback/FeedbackSocket.h index 4ae3edb7d..99e0f38ec 100644 --- a/Feedback/FeedbackSocket.h +++ b/Feedback/FeedbackSocket.h @@ -13,15 +13,17 @@ NSString *from; NSString *subject; NSString *message; + NSString *version; id delegate; } - (void)setDelegate:(id)d; -- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m; +- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m version:(NSString *)v; - (void)setFrom:(NSString *)f; - (void)setSubject:(NSString *)s; - (void)setMessage:(NSString *)m; +- (void)setVersion:(NSString *)v; @end diff --git a/Feedback/FeedbackSocket.m b/Feedback/FeedbackSocket.m index 7db20fdce..1b266d1b9 100644 --- a/Feedback/FeedbackSocket.m +++ b/Feedback/FeedbackSocket.m @@ -26,8 +26,9 @@ NSString *encodeForURL(NSString *s) NSString *f = encodeForURL(from); NSString *s = encodeForURL(subject); NSString *m = encodeForURL(message); + NSString *v = encodeForURL(version); - NSString *postString = [NSString stringWithFormat:@"from=%@&subject=%@&message=%@", f, s, m]; + NSString *postString = [NSString stringWithFormat:@"from=%@&subject=%@&message=%@&version=%@", f, s, m, v]; NSData *postData = [postString dataUsingEncoding:NSASCIIStringEncoding]; @@ -55,7 +56,7 @@ NSString *encodeForURL(NSString *s) [pool release]; } -- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m +- (void)sendFeedback: (NSString *)f subject:(NSString *)s message:(NSString *)m version:(NSString *)v { // DBLog(@"Detaching thread for feedback"); if ([f isEqualToString:@""]) @@ -65,6 +66,7 @@ NSString *encodeForURL(NSString *s) [self setFrom:f]; [self setSubject:s]; [self setMessage:m]; + [self setVersion:v]; [NSThread detachNewThreadSelector:@selector(sendFeedbackThread:) toTarget:self withObject:nil]; } @@ -128,4 +130,12 @@ NSString *encodeForURL(NSString *s) message = m; } +- (void)setVersion:(NSString *)v +{ + [v retain]; + [version release]; + + version = v; +} + @end