Changeset 3037

Show
Ignore:
Timestamp:
07/05/05 17:21:29 (4 years ago)
Author:
morris
Message:

Drop thumbnails from cache when reloading

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Footagehead/trunk/FHCache.h

    r2970 r3037  
    5252- (void)setThumbnail:(FHImage *)image forURL:(ZAURL *)url; 
    5353- (FHImage *)thumbnailForURL:(ZAURL *)url; 
     54- (void)dropThumbnailsForURL:(ZAURL *)url; 
    5455 
    5556@end 
  • Footagehead/trunk/FHCache.m

    r2970 r3037  
    131131- (void)setThumbnail:(FHImage *)image forURL:(ZAURL *)url { 
    132132        if([_thumbnails count] > 500) 
    133                 [_largeFileIcons removeObjectForKey:[[_thumbnails allKeys] objectAtIndex:0]]; 
     133                [_thumbnails removeObjectForKey:[[_thumbnails allKeys] objectAtIndex:0]]; 
    134134         
    135135        [_thumbnails setObject:image forKey:[url string]]; 
     
    142142} 
    143143 
     144 
     145 
     146- (void)dropThumbnailsForURL:(ZAURL *)url { 
     147        NSArray                 *keys; 
     148        NSString                *key, *string; 
     149        unsigned int    i, count; 
     150         
     151        keys = [_thumbnails allKeys]; 
     152        string = [url string]; 
     153         
     154        for(i = 0, count = [keys count]; i < count; i++) { 
     155                key = [keys objectAtIndex:i]; 
     156                 
     157                if([key hasPrefix:string]) 
     158                        [_thumbnails removeObjectForKey:key]; 
     159        } 
     160} 
     161 
    144162@end 
  • Footagehead/trunk/FHController.m

    r3033 r3037  
    645645 
    646646- (IBAction)reload:(id)sender { 
    647         [self loadURL:[_handler URL] selectRow:[_tableView selectedRow]]; 
     647        ZAURL   *url; 
     648         
     649        url = [_handler URL]; 
     650        [[FHCache cache] dropThumbnailsForURL:url]; 
     651        [self loadURL:url selectRow:[_tableView selectedRow]]; 
    648652} 
    649653