Adium

Changeset 23998

Show
Ignore:
Timestamp:
06/15/2008 06:59:09 PM (6 months ago)
Author:
evands
Message:

Patch from Gregory Shapiro to improve display of Address Book info in the contact inspector. We now declare the info we want and add it in a sane order rather than getting spurious information and adding it in random order. Thanks! :) Fixes #10106

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/AIInfoInspectorPane.m

    r23885 r23998  
    749749        NSString *property; 
    750750        NSEnumerator *enumerator; 
    751         NSSet *propertiesToExclude; 
    752          
    753         propertiesToExclude = [NSSet setWithObjects: 
    754                                                    kABUIDProperty, kABCreationDateProperty, kABModificationDateProperty, kABGroupNameProperty, kABPersonFlags, /* Internal data */ 
    755                                                    kABFirstNameProperty, kABLastNameProperty, kABFirstNamePhoneticProperty, kABLastNamePhoneticProperty, /* Name */ 
    756                                                    kABMiddleNameProperty, kABMiddleNamePhoneticProperty,  /* Name */ 
    757                                                    kABAIMInstantProperty, kABJabberInstantProperty, kABMSNInstantProperty, /* IM data */ 
    758                                                    kABYahooInstantProperty, kABICQInstantProperty, /* IM data */ 
     751        NSArray *propertiesToInclude; 
     752         
     753        propertiesToInclude = [NSArray arrayWithObjects: 
     754                                                   kABJobTitleProperty, kABDepartmentProperty, kABOrganizationProperty,         /* Work info */ 
     755                                                   kABHomePageProperty, kABURLsProperty,                                                                        /* Web sites */ 
     756                                                   kABEmailProperty, kABPhoneProperty, kABAddressProperty,                                      /* Contact info */ 
     757                                                   kABBirthdayProperty, kABOtherDatesProperty,                                                          /* Dates */ 
     758                                                   kABRelatedNamesProperty,                                                                                                     /* Relationships */ 
     759                                                   kABNoteProperty,                                                                                                                     /* Notes */ 
    759760                                                   nil]; 
    760         enumerator = [[ABPerson properties] objectEnumerator]; 
     761 
     762        enumerator = [propertiesToInclude objectEnumerator]; 
    761763        while ((property = [enumerator nextObject])) { 
    762                 /* Exclude: 
    763                  *      - Known unwanted properties. 
    764                  *  - Propeties with Java-style identifiers, most likely from other programs storing arbitrary data in the AB 
    765                  */ 
    766                 if (![propertiesToExclude containsObject:property] &&  
    767                         ![property hasPrefix:@"com."] && ![property hasPrefix:@"net."] && ![property hasPrefix:@"org."]) { 
     764                if ([person valueForProperty:property]) { 
    768765                        id value = [person valueForProperty:property]; 
    769766                        ABPropertyType propertyType = [ABPerson typeOfProperty:property];