Adium

Changeset 24141

Show
Ignore:
Timestamp:
07/01/2008 10:08:44 AM (5 months ago)
Author:
evands
Message:

On 10.4, force a full reload instead of just noting that row height has changed. Although this method was introduced in 10.4, it works poorly at best there, whereas it seems to work reliably in 10.5. Fixes #9893. Fixes #10020. Fixes #9886.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Frameworks/Adium Framework/Source/ESContactAlertsViewController.m

    r23643 r24141  
    5151int globalAlertAlphabeticalSort(id objectA, id objectB, void *context); 
    5252 
     53//#define HEIGHT_DEBUG 
     54 
    5355@implementation ESContactAlertsViewController 
    5456 
     
    5658- (void)awakeFromNib 
    5759{ 
     60        AILogWithSignature(@""); 
    5861        [expandStateDict release]; expandStateDict = [[NSMutableDictionary alloc] init]; 
    5962        [requiredHeightDict release]; requiredHeightDict = [[NSMutableDictionary alloc] init]; 
     
    146149{ 
    147150        [self calculateAllHeights]; 
    148         [outlineView_summary noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [outlineView_summary numberOfRows]-1)]]; 
     151        [outlineView_summary reloadData]; 
     152//      [outlineView_summary noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [outlineView_summary numberOfRows]-1)]]; 
    149153} 
    150154 
     
    406410                                tableColumnWidth = [tableColumn width]; 
    407411                        } 
    408                          
     412 
    409413                        thisHeight = [attributedTitle heightWithWidth:tableColumnWidth]; 
    410414                        if (thisHeight > necessaryHeight) necessaryHeight = thisHeight; 
     415#ifdef HEIGHT_DEBUG                      
     416                        AILogWithSignature(@"%@: width %f height %f", [attributedTitle string], tableColumnWidth, thisHeight); 
     417#nedif 
    411418                        [attributedTitle release]; 
    412419                } 
    413420        } 
    414421         
    415         necessaryHeight += VERTICAL_ROW_PADDING;         
    416  
     422        necessaryHeight += VERTICAL_ROW_PADDING; 
     423#ifdef HEIGHT_DEBUG 
     424        AILogWithSignature(@"%@: %f", item, (enforceMinimumHeight ?  
     425                                                                                 ((necessaryHeight > MINIMUM_ROW_HEIGHT) ? necessaryHeight : MINIMUM_ROW_HEIGHT) : 
     426                                                                                 necessaryHeight)); 
     427#endif 
    417428        [requiredHeightDict setObject:[NSNumber numberWithFloat:(enforceMinimumHeight ?  
    418429                                                                                                                         ((necessaryHeight > MINIMUM_ROW_HEIGHT) ? necessaryHeight : MINIMUM_ROW_HEIGHT) : 
     
    459470                                                                                                                                 group:PREF_GROUP_CONTACT_ALERTS 
    460471                                                                                         objectIgnoringInheritance:listObject]; 
    461         AILogWithSignature(@"Looking at %@, got %@", listObject, contactAlertsDict); 
    462472        [contactAlertsEvents release]; contactAlertsEvents = [[NSMutableArray alloc] init]; 
    463473        [contactAlertsActions release]; contactAlertsActions = [[NSMutableArray alloc] init]; 
     
    485495        [outlineView_summary reloadData]; 
    486496        [self calculateAllHeights]; 
    487         [outlineView_summary noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [outlineView_summary numberOfRows])]]; 
    488  
     497        if ([NSApp isOnLeopardOrBetter]) 
     498                [outlineView_summary noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [outlineView_summary numberOfRows])]]; 
     499        else 
     500                [outlineView_summary reloadData]; 
     501         
    489502        if (selectedEventID) { 
    490503                int actionsIndex = [contactAlertsEvents indexOfObject:selectedEventID]; 
     
    581594 
    582595        [self calculateHeightForItem:item]; 
    583         [outlineView noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:item]]]; 
    584 //      [outlineView display]; 
     596        if ([NSApp isOnLeopardOrBetter]) 
     597                [outlineView noteHeightOfRowsWithIndexesChanged:[NSIndexSet indexSetWithIndex:[outlineView rowForItem:item]]]; 
     598        else 
     599                [outlineView_summary reloadData]; 
    585600} 
    586601