adium 2620:90c8519e0c79: These constants are defined, in Foundat...

commits at adium.im commits at adium.im
Sun Aug 23 02:12:22 UTC 2009


details:	http://hg.adium.im/adium/rev/90c8519e0c79
revision:	2620:90c8519e0c79
author:		Peter Hosey <hg at boredzo.org>
date:		Sat Aug 22 19:17:44 2009 -0700

These constants are defined, in FoundationErrors.h. Using the names allows us to banish three comments, one of which was inaccurate.
Subject: adium 2621:62ad02b3cf83: Merged up the space dust.

details:	http://hg.adium.im/adium/rev/62ad02b3cf83
revision:	2621:62ad02b3cf83
author:		Peter Hosey <hg at boredzo.org>
date:		Sat Aug 22 19:18:15 2009 -0700

Merged up the space dust.

diffs (51 lines):

diff -r 3571e5f41300 -r 62ad02b3cf83 Frameworks/AIUtilities Framework/Source/AIStringAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Fri Aug 21 20:25:45 2009 -0700
+++ b/Frameworks/AIUtilities Framework/Source/AIStringAdditions.m	Sat Aug 22 19:18:15 2009 -0700
@@ -133,18 +133,11 @@
 		if ([[error domain] isEqualToString:NSCocoaErrorDomain]) {
 			int		errorCode = [error code];
 
-			//XXX - I'm sure these constants are defined somewhere, but I can't find them. -eds
-			if (errorCode == 260) {
-				//File not found.
+			if (errorCode == NSFileReadNoSuchFileError) {
 				string = nil;
 				handled = YES;
 
-			} else if (errorCode == 261) {
-				/* Reason: File could not be opened using text encoding Unicode (UTF-8).
-				 * Description: Text encoding Unicode (UTF-8) is not applicable.
-				 *
-				 * We couldn't read the file as UTF8.  Let the system try to determine the encoding.
-				 */
+			} else if (errorCode == NSFileReadInapplicableStringEncodingError) {
 				NSError				*newError = nil;
 
 				string = [self stringWithContentsOfFile:path
diff -r 3571e5f41300 -r 62ad02b3cf83 Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m
--- a/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m	Fri Aug 21 20:25:45 2009 -0700
+++ b/Frameworks/AutoHyperlinks Framework/Source/AHMarkedHyperlink.m	Sat Aug 22 19:18:15 2009 -0700
@@ -101,13 +101,18 @@
 
 - (void)setURLFromString:(NSString *)inString
 {
-	NSString	*linkString;
+	NSString	*linkString, *preString;
 
+	preString = (NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(kCFAllocatorDefault, 
+																					(CFStringRef)inString, 
+																					CFSTR(""), 
+																					kCFStringEncodingUTF8);
+	
 	linkString = (NSString *)CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
-	                                        (CFStringRef)inString,
-	                                        (CFStringRef)@"#[]",
-	                                        NULL,
-	                                        kCFStringEncodingUTF8); // kCFStringEncodingISOLatin1 );
+																	 preString? (CFStringRef)preString : (CFStringRef)inString,
+																	 (CFStringRef)@"#[]",
+																	 NULL,
+																	 kCFStringEncodingUTF8); // kCFStringEncodingISOLatin1 );
 
 	[linkURL release];
 	linkURL = [[NSURL alloc] initWithString:linkString];




More information about the commits mailing list