Changeset 5190

Show
Ignore:
Timestamp:
01/21/08 11:41:22 (6 months ago)
Author:
morris
Message:

Also reload parent directories when adding/deleting files

Files:

Legend:

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

    r5177 r5190  
    560560 
    561561- (void)filesShouldReload:(NSNotification *)notification { 
    562         NSString        *path, *selectPath
     562        NSString        *path, *selectPath, *currentPath
    563563 
    564564        path = [[notification userInfo] objectForKey:WCFilePathKey]; 
    565565        selectPath = [[notification userInfo] objectForKey:WCFileSelectPathKey]; 
    566  
    567         if([path isEqualToString:[[self _currentPath] path]]) { 
    568                 [self _setSelectPath:selectPath]; 
    569  
    570                 [[[self connection] cache] removeFilesForPath:[[self _currentPath] path]]; 
     566        currentPath = [[self _currentPath] path]; 
     567 
     568        if([currentPath isEqualToString:path] || [currentPath isEqualToString:[path stringByDeletingLastPathComponent]]) { 
     569                if([currentPath isEqualToString:path]) 
     570                        [self _setSelectPath:selectPath]; 
     571                else 
     572                        [self _setSelectPath:[[self selectedFile] path]]; 
     573 
     574                [[[self connection] cache] removeFilesForPath:currentPath]; 
    571575                 
    572576                [self _changeDirectory:[self _currentPath]];