Changeset 4828

Show
Ignore:
Timestamp:
06/07/07 13:52:47 (1 year ago)
Author:
morris
Message:

Fix a problem with selection path clearing when revealing in files from search window

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • WiredClient/trunk/WCFiles.m

    r4799 r4828  
    4242- (void)_setCurrentPath:(WCFile *)path; 
    4343- (WCFile *)_currentPath; 
     44- (void)_setSelectPath:(NSString *)path; 
     45- (NSString *)_selectPath; 
    4446 
    4547- (void)_updateMenu; 
     
    6769        _listPath               = [path retain]; 
    6870        _browserPath    = [path retain]; 
    69         _selectPath             = [selectPath retain]; 
     71         
     72        [self _setSelectPath:selectPath]; 
    7073 
    7174        _history                = [[NSMutableArray alloc] init]; 
     
    119122         
    120123        return NULL; 
     124} 
     125 
     126 
     127 
     128- (void)_setSelectPath:(NSString *)path { 
     129        [path retain]; 
     130        [_selectPath release]; 
     131         
     132        _selectPath = path; 
     133} 
     134 
     135 
     136 
     137- (NSString *)_selectPath { 
     138        return _selectPath; 
    121139} 
    122140 
     
    184202        [[_filesBrowser matrixInColumn:[_filesBrowser lastColumn]] setMenu:[_filesBrowser menu]]; 
    185203 
    186         if(_selectPath) { 
    187                 [_filesTableView selectRowWithStringValue:[_selectPath lastPathComponent]]; 
    188                  
    189                 [_selectPath release]; 
    190                 _selectPath = NULL; 
    191         } 
     204        if([self _selectPath]) 
     205                [_filesTableView selectRowWithStringValue:[[self _selectPath] lastPathComponent]]; 
    192206         
    193207        [[self connection] addObserver:self 
     
    390404        [_listPath release]; 
    391405        [_browserPath release]; 
     406        [_selectPath release]; 
    392407 
    393408        [super dealloc]; 
     
    548563 
    549564        if([path isEqualToString:[[self _currentPath] path]]) { 
    550                 _selectPath = [selectPath retain]; 
     565                [self _setSelectPath:selectPath]; 
    551566 
    552567                [[[self connection] cache] removeFilesForPath:[[self _currentPath] path]]; 
     
    767782- (IBAction)back:(id)sender { 
    768783        if([_backButton isEnabled]) { 
    769                 _selectPath = [[[self _currentPath] path] retain]; 
     784                [self _setSelectPath:[[self _currentPath] path]]; 
    770785 
    771786                [self _changeDirectory:[_history objectAtIndex:--_historyPosition]]; 
     
    904919 
    905920- (IBAction)reloadFiles:(id)sender { 
    906         _selectPath = [[[self selectedFile] path] retain]; 
     921        [self _setSelectPath:[[self selectedFile] path]]; 
    907922 
    908923        [[[self connection] cache] removeFilesForPath:[[self _currentPath] path]];