adium 3914:9f7e5f0baf6e: It seems I messed something up when com...

commits at adium.im commits at adium.im
Tue May 24 16:42:21 UTC 2011


details:	http://hg.adium.im/adium/rev/9f7e5f0baf6e
revision:	3914:9f7e5f0baf6e
branch:		(none)
author:		Thijs Alkemade <thijsalkemade at gmail.com>
date:		Tue May 24 18:41:58 2011 +0200

It seems I messed something up when committing this nib. Also, make sure the name is actually longer than @"" when using initials.

diffs (53 lines):

diff -r 86b61d53cdf0 -r 9f7e5f0baf6e Frameworks/Adium Framework/Source/AIAddressBookController.m
--- a/Frameworks/Adium Framework/Source/AIAddressBookController.m	Tue May 24 18:13:18 2011 +0200
+++ b/Frameworks/Adium Framework/Source/AIAddressBookController.m	Tue May 24 18:41:58 2011 +0200
@@ -483,22 +483,22 @@
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_FIRST_FULL
 														 withString:firstName ? firstName : @""];
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_FIRST_INITIAL
-														 withString:firstName ? [firstName substringToIndex:1] : @""];
+														 withString:([firstName length] > 0) ? [firstName substringToIndex:1] : @""];
 	
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_MIDDLE_FULL
 														 withString:middleName ? middleName : @""];
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_MIDDLE_INITIAL
-														 withString:middleName ? [middleName substringToIndex:1] : @""];
+														 withString:([middleName length] > 0) ? [middleName substringToIndex:1] : @""];
 	
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_LAST_FULL
 														 withString:lastName ? lastName : @""];
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_LAST_INITIAL
-														 withString:lastName ? [lastName substringToIndex:1] : @""];
+														 withString:([lastName length] > 0) ? [lastName substringToIndex:1] : @""];
 
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_NICK_FULL
 														 withString:nickName ? nickName : @""];
 	displayName = [displayName stringByReplacingOccurrencesOfString:FORMAT_NICK_INITIAL
-														 withString:nickName ? [nickName substringToIndex:1] : @""];
+														 withString:([nickName length] > 0) ? [nickName substringToIndex:1] : @""];
 
 	if (havePhonetic) {
 		*phonetic = displayFormat;
@@ -506,17 +506,17 @@
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_FIRST_FULL
 														 withString:phoneticFirstName ? phoneticFirstName : @""];
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_FIRST_INITIAL
-														 withString:phoneticFirstName ? [phoneticFirstName substringToIndex:1] : @""];
+														 withString:([phoneticFirstName length] > 0) ? [phoneticFirstName substringToIndex:1] : @""];
 		
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_MIDDLE_FULL
 														 withString:phoneticMiddleName ? phoneticMiddleName : @""];
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_MIDDLE_INITIAL
-														 withString:phoneticMiddleName ? [phoneticMiddleName substringToIndex:1] : @""];
+														 withString:([phoneticMiddleName length] > 0) ? [phoneticMiddleName substringToIndex:1] : @""];
 		
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_LAST_FULL
 														 withString:phoneticLastName ? phoneticLastName : @""];
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_LAST_INITIAL
-														 withString:phoneticLastName ? [phoneticLastName substringToIndex:1] : @""];
+														 withString:([phoneticLastName length] > 0) ? [phoneticLastName substringToIndex:1] : @""];
 		
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_NICK_FULL withString:@""];
 		*phonetic = [*phonetic stringByReplacingOccurrencesOfString:FORMAT_NICK_INITIAL withString:@""];
diff -r 86b61d53cdf0 -r 9f7e5f0baf6e Resources/AddressBookPrefs.nib/keyedobjects.nib
Binary file Resources/AddressBookPrefs.nib/keyedobjects.nib has changed




More information about the commits mailing list