Created
December 2, 2009 00:26
-
-
Save justin/246780 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/External/jrfeedbackprovider/lib/JRFeedbackController.m b/External/jrfeedbackprovider/lib/JRFeedbackController.m | |
--- a/External/jrfeedbackprovider/lib/JRFeedbackController.m | |
+++ b/External/jrfeedbackprovider/lib/JRFeedbackController.m | |
@@ -9,6 +9,7 @@ | |
#import <AddressBook/AddressBook.h> | |
#import "NSURLRequest+postForm.h" | |
#import <SystemConfiguration/SCNetwork.h> | |
+#import <SystemConfiguration/SystemConfiguration.h> | |
#if USE_GROWL | |
#import <Growl/GrowlApplicationBridge.h> | |
@@ -34,9 +35,16 @@ | |
+ (void)showFeedbackWithBugDetails:(NSString *)details { | |
SCNetworkConnectionFlags reachabilityFlags; | |
- Boolean reachabilityResult = SCNetworkCheckReachabilityByName([[[JRFeedbackController postURL] host] UTF8String], &reachabilityFlags); | |
- | |
- //NSLog(@"reachabilityFlags: %lx", reachabilityFlags); | |
+ const char *hostname = [[[JRFeedbackController postURL] host] UTF8String]; | |
+#ifdef MAC_OS_X_VERSION_10_6 | |
+ SCNetworkReachabilityRef reachability = SCNetworkReachabilityCreateWithName(NULL, hostname); | |
+ Boolean reachabilityResult = SCNetworkReachabilityGetFlags(reachability, &reachabilityFlags); | |
+ CFRelease(reachability); | |
+#else | |
+ Boolean reachabilityResult = SCNetworkCheckReachabilityByName(hostname, &reachabilityFlags); | |
+#endif | |
+ | |
+// NSLog(@"reachabilityFlags: %lx", reachabilityFlags); | |
BOOL showFeedbackWindow = reachabilityResult | |
&& (reachabilityFlags & kSCNetworkFlagsReachable) | |
&& !(reachabilityFlags & kSCNetworkFlagsConnectionRequired) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment