Changeset 4706
- Timestamp:
- 04/23/07 18:39:24 (2 years ago)
- Files:
-
- Footagehead/trunk/English.lproj/InfoPlist.strings (modified) (1 diff)
- Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (4 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/English.lproj/MainMenu.nib/objects.nib (modified) (previous)
- Footagehead/trunk/English.lproj/ReleaseNotes.rtf (modified) (1 diff)
- Footagehead/trunk/English.lproj/Window.nib/classes.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/Window.nib/info.nib (modified) (2 diffs)
- Footagehead/trunk/English.lproj/Window.nib/keyedobjects.nib (modified) (previous)
- Footagehead/trunk/FHCache.h (modified) (1 diff)
- Footagehead/trunk/FHCache.m (modified) (2 diffs)
- Footagehead/trunk/FHController.h (modified) (4 diffs)
- Footagehead/trunk/FHController.m (modified) (21 diffs)
- Footagehead/trunk/FHFeedHandler.h (modified) (1 diff)
- Footagehead/trunk/FHFeedHandler.m (modified) (1 diff)
- Footagehead/trunk/FHFile.h (modified) (1 diff)
- Footagehead/trunk/FHFile.m (modified) (1 diff)
- Footagehead/trunk/FHFileCell.h (modified) (1 diff)
- Footagehead/trunk/FHFileCell.m (modified) (1 diff)
- Footagehead/trunk/FHFileHandler.h (modified) (1 diff)
- Footagehead/trunk/FHFileHandler.m (modified) (1 diff)
- Footagehead/trunk/FHFlickrHandler.h (modified) (1 diff)
- Footagehead/trunk/FHFlickrHandler.m (modified) (1 diff)
- Footagehead/trunk/FHFullscreenWindow.h (modified) (1 diff)
- Footagehead/trunk/FHFullscreenWindow.m (modified) (7 diffs)
- Footagehead/trunk/FHHTMLHandler.h (modified) (1 diff)
- Footagehead/trunk/FHHTMLHandler.m (modified) (1 diff)
- Footagehead/trunk/FHHTMLParser.h (modified) (1 diff)
- Footagehead/trunk/FHHTMLParser.m (modified) (1 diff)
- Footagehead/trunk/FHHandler.h (modified) (1 diff)
- Footagehead/trunk/FHHandler.m (modified) (1 diff)
- Footagehead/trunk/FHImage.h (modified) (2 diffs)
- Footagehead/trunk/FHImage.m (modified) (2 diffs)
- Footagehead/trunk/FHImageHandler.h (modified) (1 diff)
- Footagehead/trunk/FHImageHandler.m (modified) (1 diff)
- Footagehead/trunk/FHImageLoader.h (modified) (1 diff)
- Footagehead/trunk/FHImageLoader.m (modified) (10 diffs)
- Footagehead/trunk/FHImageView.h (modified) (2 diffs)
- Footagehead/trunk/FHImageView.m (modified) (11 diffs)
- Footagehead/trunk/FHRARHandler.h (modified) (1 diff)
- Footagehead/trunk/FHRARHandler.m (modified) (1 diff)
- Footagehead/trunk/FHRangeHandler.h (modified) (1 diff)
- Footagehead/trunk/FHRangeHandler.m (modified) (1 diff)
- Footagehead/trunk/FHSettings.h (modified) (1 diff)
- Footagehead/trunk/FHSettings.m (modified) (1 diff)
- Footagehead/trunk/FHSpotlightHandler.h (modified) (1 diff)
- Footagehead/trunk/FHSpotlightHandler.m (modified) (4 diffs)
- Footagehead/trunk/FHTableView.h (modified) (1 diff)
- Footagehead/trunk/FHTableView.m (modified) (2 diffs)
- Footagehead/trunk/FHURLHandler.h (modified) (1 diff)
- Footagehead/trunk/FHURLHandler.m (modified) (1 diff)
- Footagehead/trunk/FHWindowController.h (modified) (3 diffs)
- Footagehead/trunk/FHWindowController.m (modified) (26 diffs)
- Footagehead/trunk/FHZipHandler.h (modified) (1 diff)
- Footagehead/trunk/FHZipHandler.m (modified) (1 diff)
- Footagehead/trunk/Footagehead.xcconfig (modified) (1 diff)
- Footagehead/trunk/NSBitmapImageRep-FHAdditions.h (modified) (1 diff)
- Footagehead/trunk/NSBitmapImageRep-FHAdditions.m (modified) (1 diff)
- Footagehead/trunk/NSData-FHAdditions.h (modified) (1 diff)
- Footagehead/trunk/NSData-FHAdditions.m (modified) (1 diff)
- Footagehead/trunk/NSImage-FHAdditions.h (modified) (1 diff)
- Footagehead/trunk/NSImage-FHAdditions.m (modified) (1 diff)
- Footagehead/trunk/main.m (modified) (1 diff)
- Footagehead/trunk/prefix.pch (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/English.lproj/InfoPlist.strings
r4369 r4706 2 2 CFBundleName = "Footagehead"; 3 3 CFBundleShortVersionString = "Footagehead 1.2.2"; 4 CFBundleGetInfoString = "Footagehead 1.2.2, Copyright 2003-200 6Zanka Software.";5 NSHumanReadableCopyright = "Copyright 2003-200 6Zanka Software.";4 CFBundleGetInfoString = "Footagehead 1.2.2, Copyright 2003-2007 Zanka Software."; 5 NSHumanReadableCopyright = "Copyright 2003-2007 Zanka Software."; Footagehead/trunk/English.lproj/MainMenu.nib/classes.nib
r4465 r4706 3 3 {CLASS = FHBrowserView; LANGUAGE = ObjC; SUPERCLASS = NSMatrix; }, 4 4 { 5 ACTIONS = {6 autoSwitch = id;7 delete = id;8 firstFile = id;9 lastFile = id;10 nextImage = id;11 nextPage = id;12 open = id;13 openFile = id;14 openMenu = id;15 openParent = id;16 openSpotlight = id;17 openURL = id;18 previousImage = id;19 previousPage = id;20 reload = id;21 revealInFinder = id;22 rotateLeft = id;23 rotateRight = id;24 setAsDesktopPicture = id;25 slideshow = id;26 toggleStatusBar = id;27 zoom = id;28 };29 5 CLASS = FHController; 30 6 LANGUAGE = ObjC; … … 34 10 "_fullscreenImageView" = FHImageView; 35 11 "_fullscreenPanel" = NSPanel; 12 "_goMenu" = NSMenu; 36 13 "_imageView" = FHImageView; 37 14 "_leftStatusTextField" = NSTextField; … … 62 39 "_zoomButton" = NSButton; 63 40 }; 64 SUPERCLASS = WIWindowController;41 SUPERCLASS = NSObject; 65 42 }, 66 43 { … … 77 54 }, 78 55 { 79 ACTIONS = {cancelSheet = id; submitSheet = id; }; 56 ACTIONS = { 57 cancelSheet = id; 58 go = id; 59 moveToTrash = id; 60 open = id; 61 openParent = id; 62 openSpotlight = id; 63 openURL = id; 64 reload = id; 65 revealInFinder = id; 66 rotateLeft = id; 67 rotateRight = id; 68 setAsDesktopBackground = id; 69 submitSheet = id; 70 toggleStatusBar = id; 71 zoomMode = id; 72 zoomToFit = id; 73 }; 80 74 CLASS = FirstResponder; 81 75 LANGUAGE = ObjC; Footagehead/trunk/English.lproj/MainMenu.nib/info.nib
r4705 r4706 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string>8 60 245395 374 0 0 1920 1178 </string>6 <string>838 346 395 374 0 0 1920 1178 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> 9 9 <key>29</key> 10 <string>854 978 365 44 0 0 1920 1178 </string> 11 <key>592</key> 12 <string>118 501 223 118 0 0 1280 1002 </string> 10 <string>854 977 400 44 0 0 1920 1178 </string> 13 11 </dict> 14 12 <key>IBFramework Version</key> … … 18 16 <key>IBOpenObjects</key> 19 17 <array> 20 <integer>21</integer>21 <integer>302</integer>22 18 <integer>29</integer> 23 19 </array> 24 20 <key>IBSystem Version</key> 25 <string>8 L2127</string>21 <string>8P135</string> 26 22 </dict> 27 23 </plist> Footagehead/trunk/English.lproj/ReleaseNotes.rtf
r4465 r4706 486 486 \f1\b0\fs24 \cf0 \ 487 487 \ 488 Copyright \'a9 2003-200 6Axel Andersson\488 Copyright \'a9 2003-2007 Axel Andersson\ 489 489 All rights reserved.\ 490 490 \ Footagehead/trunk/English.lproj/Window.nib/classes.nib
r4705 r4706 20 20 }, 21 21 { 22 ACTIONS = { 23 firstFile = id; 24 lastFile = id; 25 nextImage = id; 26 nextPage = id; 27 openDirectory = id; 28 openFile = id; 29 openParent = id; 30 previousImage = id; 31 previousPage = id; 32 }; 22 33 CLASS = FHWindowController; 23 34 LANGUAGE = ObjC; 24 35 OUTLETS = { 36 "_contentBox" = NSBox; 25 37 "_fileTableColumn" = NSTableColumn; 26 38 "_imageView" = FHImageView; 39 "_leftStatusTextField" = NSTextField; 27 40 "_leftView" = NSView; 28 "_progressIndicator" = NSProgressIndicator; 41 "_openSpotlightPanel" = NSPanel; 42 "_openSpotlightTextView" = NSTextView; 43 "_openURLPanel" = NSPanel; 44 "_openURLPopUpButton" = NSPopUpButton; 45 "_openURLTextView" = NSTextView; 46 "_rightStatusTextField" = NSTextField; 29 47 "_rightView" = NSView; 30 48 "_scrollView" = NSScrollView; 31 49 "_splitView" = WISplitView; 50 "_statusBox" = NSBox; 32 51 "_tableView" = FHTableView; 33 52 }; … … 39 58 LANGUAGE = ObjC; 40 59 SUPERCLASS = NSObject; 60 }, 61 { 62 ACTIONS = {cancelSheet = id; submitSheet = id; }; 63 CLASS = NSWindowController; 64 LANGUAGE = ObjC; 65 SUPERCLASS = NSResponder; 41 66 }, 42 67 {CLASS = WISplitView; LANGUAGE = ObjC; SUPERCLASS = NSSplitView; }, Footagehead/trunk/English.lproj/Window.nib/info.nib
r4705 r4706 4 4 <dict> 5 5 <key>IBDocumentLocation</key> 6 <string>10 19 123403 407 0 0 1920 1178 </string>6 <string>1063 138 403 407 0 0 1920 1178 </string> 7 7 <key>IBEditorPositions</key> 8 8 <dict> … … 15 15 <array> 16 16 <integer>7</integer> 17 <integer>52</integer> 18 <integer>82</integer> 17 19 </array> 18 20 <key>IBSystem Version</key> 19 <string>8P 2137</string>21 <string>8P135</string> 20 22 </dict> 21 23 </plist> Footagehead/trunk/FHCache.h
r3400 r4706 2 2 3 3 /* 4 * Copyright (c) 2003-200 5Axel Andersson4 * Copyright (c) 2003-2007 Axel Andersson 5 5 * All rights reserved. 6 6 * Footagehead/trunk/FHCache.m
r3400 r4706 2 2 3 3 /* 4 * Copyright (c) 2003-200 5Axel Andersson4 * Copyright (c) 2003-2007 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 62 62 [_fileIcons release]; 63 63 [_largeFileIcons release]; 64 [_thumbnails release]; 64 65 65 66 [super dealloc]; Footagehead/trunk/FHController.h
r4704 r4706 2 2 3 3 /* 4 * Copyright (c) 2003-200 5Axel Andersson4 * Copyright (c) 2003-2007 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 31 31 @class FHHandler, FHFile; 32 32 33 @interface FHController : WIWindowController{33 @interface FHController : NSObject { 34 34 IBOutlet NSMenuItem *_openSpotlightMenuItem; 35 35 36 IBOutlet NSMenu *_goMenu; 37 36 38 IBOutlet NSMenu *_viewMenu; 37 39 IBOutlet NSMenuItem *_toggleStatusBarMenuItem; … … 95 97 BOOL _deletingFile; 96 98 unsigned int _spinners; 97 unsigned int _menuItems; 99 100 NSUInteger _menuItems, _initialMenuItems; 98 101 } 99 102 100 103 101 + (FHController *)controller; 104 //- (IBAction)open:(id)sender; 105 //- (IBAction)openURL:(id)sender; 106 //- (IBAction)openSpotlight:(id)sender; 102 107 103 - (IBAction)open:(id)sender; 104 - (IBAction)openURL:(id)sender; 105 - (IBAction)openSpotlight:(id)sender; 106 - (IBAction)openParent:(id)sender; 107 - (IBAction)openMenu:(id)sender; 108 /*- (IBAction)openMenu:(id)sender; 108 109 - (IBAction)openFile:(id)sender; 109 110 - (IBAction)firstFile:(id)sender; … … 113 114 - (IBAction)previousPage:(id)sender; 114 115 - (IBAction)nextPage:(id)sender; 115 - (IBAction)reload:(id)sender;116 - (IBAction)zoom:(id)sender;117 - (IBAction)rotateRight:(id)sender;118 - (IBAction)rotateLeft:(id)sender;119 116 - (IBAction)slideshow:(id)sender; 120 117 - (IBAction)autoSwitch:(id)sender; 121 - (IBAction)revealInFinder:(id)sender; 122 - (IBAction)setAsDesktopPicture:(id)sender; 123 - (IBAction)delete:(id)sender; 124 - (IBAction)toggleStatusBar:(id)sender; 125 118 */ 126 119 @end Footagehead/trunk/FHController.m
r4705 r4706 2 2 3 3 /* 4 * Copyright (c) 2003-200 5Axel Andersson4 * Copyright (c) 2003-2007 Axel Andersson 5 5 * All rights reserved. 6 6 * … … 37 37 #import "FHImageView.h" 38 38 #import "FHSettings.h" 39 40 41 39 #import "FHWindowController.h" 42 40 43 #define FHUnloadImageCount 544 #define FHPreloadImageCount 1045 46 static FHController *sharedController;47 48 49 41 @interface FHController(Private) 50 42 51 - (void)_selectFileAtIndex:(unsigned int)index; 52 - (FHFile *)_selectedFile; 53 - (FHFile *)_fileAtIndex:(unsigned int)index; 54 55 - (void)_loadURL:(WIURL *)url; 56 - (void)_loadURL:(WIURL *)url selectRow:(int)row; 57 - (void)_loadURL:(WIURL *)url selectFile:(NSString *)file; 58 - (void)_loadURL:(WIURL *)url selectRow:(int)row file:(NSString *)file; 59 - (void)_reloadURL:(WIURL *)url; 60 - (void)_loadFile:(FHFile *)file; 61 62 - (void)_addMenuItemWithPath:(NSString *)path keyEquivalent:(NSString *)keyEquivalent; 63 - (void)_reloadVolumesMenu; 64 - (void)_reloadPathMenu; 43 - (void)_buildGoMenu; 44 - (void)_reloadVolumesInGoMenu; 45 - (void)_addGoMenuItemWithPath:(NSString *)path keyEquivalent:(NSString *)keyEquivalent; 46 - (void)_reloadPathsInGoMenuForHandler:(FHHandler *)handler; 47 65 48 - (void)_reloadScreens; 66 49 - (void)_reloadScreenBackgrounds; … … 68 51 - (void)_startSpinning; 69 52 - (void)_stopSpinning; 70 - (void)_updateImage;71 - (void)_updateButtons;72 - (void)_updateStatus;73 - (void)_updateLeftStatus;74 - (void)_updateRightStatus;75 53 - (void)_updateFullscreenStatus; 76 - (void)_updateTableView;77 54 78 55 - (NSToolbar *)_toolbar; 79 56 80 - (void)_toggleStatusBar:(BOOL)show;81 82 57 @end 83 58 … … 85 60 @implementation FHController(Private) 86 61 87 - (void)_selectFileAtIndex:(unsigned int)index { 88 [_loadImageTimer setFireDate:[NSDate distantFuture]]; 89 [_tableView selectRow:index byExtendingSelection:NO]; 90 [_tableView scrollRowToVisible:index]; 91 } 92 93 94 95 - (FHFile *)_selectedFile { 96 int row; 97 98 row = [_tableView selectedRow]; 99 100 if(row < 0) 101 return NULL; 102 103 return [self _fileAtIndex:row]; 104 } 105 106 107 108 - (FHFile *)_fileAtIndex:(NSUInteger)index { 109 return [[_handler files] objectAtIndex:index]; 62 - (void)_buildGoMenu { 63 _initialMenuItems = [_goMenu numberOfItems]; 64 65 [self _reloadVolumesInGoMenu]; 66 67 [self _addGoMenuItemWithPath:@"~" keyEquivalent:@"H"]; 68 [self _addGoMenuItemWithPath:@"~/Desktop" keyEquivalent:@"d"]; 69 [self _addGoMenuItemWithPath:@"~/Pictures" keyEquivalent:@"P"]; 70 71 [_goMenu addItem:[NSMenuItem separatorItem]]; 72 _menuItems++; 73 } 74 75 76 77 - (void)_reloadVolumesInGoMenu { 78 NSEnumerator *enumerator; 79 NSMenuItem *item; 80 NSString *volume, *path; 81 NSImage *icon; 82 NSUInteger i = _initialMenuItems; 83 84 if((NSUInteger) [_goMenu numberOfItems] > _initialMenuItems) { 85 while(![[_goMenu itemAtIndex:_initialMenuItems] isSeparatorItem]) { 86 [_goMenu removeItemAtIndex:_initialMenuItems]; 87 _menuItems--; 88 } 89 } 90 91 enumerator = [[[NSFileManager defaultManager] directoryContentsAtPath:@"/Volumes/"] objectEnumerator]; 92 93 while((volume = [enumerator nextObject])) { 94 if([volume hasPrefix:@"."]) 95 continue; 96 97 path = [NSSWF:@"/Volumes/%@", volume]; 98 icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; 99 [icon setSize:NSMakeSize(16.0, 16.0)]; 100 101 item = [NSMenuItem itemWithTitle:[[NSFileManager defaultManager] displayNameAtPath:path] 102 action:@selector(go:)]; 103 [item setImage:icon]; 104 [item setRepresentedObject:[WIURL fileURLWithPath:path]]; 105 [_goMenu insertItem:item atIndex:i]; 106 _menuItems++; 107 i++; 108 } 109 110 if(i == (NSUInteger) [_goMenu numberOfItems] || ![[_goMenu itemAtIndex:i] isSeparatorItem]) { 111 [_goMenu insertItem:[NSMenuItem separatorItem] atIndex:i]; 112 _menuItems++; 113 } 114 } 115 116 117 118 - (void)_addGoMenuItemWithPath:(NSString *)path keyEquivalent:(NSString *)keyEquivalent { 119 NSMenuItem *item; 120 NSImage *icon; 121 122 path = [path stringByStandardizingPath]; 123 icon = [[NSWorkspace sharedWorkspace] iconForFile:path]; 124 [icon setSize:NSMakeSize(16.0, 16.0)]; 125 126 item = [NSMenuItem itemWithTitle:[[NSFileManager defaultManager] displayNameAtPath:path] 127 action:@selector(go:) 128 keyEquivalent:keyEquivalent]; 129 130 [item setImage:icon]; 131 [item setRepresentedObject:[WIURL fileURLWithPath:path]]; 132 [_goMenu addItem:item]; 133 134 _menuItems++; 135 } 136 137 138 139 - (void)_reloadPathsInGoMenuForHandler:(FHHandler *)handler { 140 NSArray *stringComponents, *urlComponents; 141 NSMenuItem *item; 142 NSImage *icon; 143 NSString *name; 144 WIURL *url; 145 NSUInteger i, count, items; 146 147 stringComponents = [handler stringComponents]; 148 urlComponents = [handler URLComponents]; 149 count = [stringComponents count]; 150 items = [_goMenu numberOfItems]; 151 152 for(i = 0; i < count; i++) { 153 if(_menuItems + i + _initialMenuItems < items) { 154 name = [[_goMenu itemAtIndex:i + _menuItems + _initialMenuItems] title]; 155 156 if([name isEqualToString:[stringComponents objectAtIndex:i]]) 157 continue; 158 159 [_goMenu removeItemAtIndex:_menuItems + i + _initialMenuItems]; 160 items--; 161 } 162 163 url = [urlComponents objectAtIndex:i]; 164 165 item = [NSMenuItem itemWithTitle:[stringComponents objectAtIndex:i] 166 action:@selector(go:)]; 167 [item setRepresentedObject:url]; 168 169 icon = [handler iconForURL:url]; 170 171 if(icon) { 172 [icon setSize:NSMakeSize(16.0, 16.0)]; 173 [item setImage:icon]; 174 } 175 176 [_goMenu insertItem:item atIndex:_menuItems + i + _initialMenuItems]; 177 items++; 178 } 179 180 while(items > _menuItems + count + _initialMenuItems) { 181 [_goMenu removeItemAtIndex:_menuItems + count + _initialMenuItems]; 182 183 items--; 184 } 110 185 } 111 186 … … 113 188 114 189 #pragma mark - 115 116 - (void)_loadURL:(WIURL *)url {117 [self _loadURL:url selectRow:0 file:NULL];118 }119 120 121 122 - (void)_loadURL:(WIURL *)url selectRow:(int)row {123 [self _loadURL:url selectRow:row file:NULL];124 }125 126 127 128 - (void)_loadURL:(WIURL *)url selectFile:(NSString *)file {129 [self _loadURL:url selectRow:0 file:file];130 }131 132 133 134 - (void)_loadURL:(WIURL *)url selectRow:(int)row file:(NSString *)file {135 NSArray *files;136 FHHandler *handler;137 unsigned int i, count;138 BOOL select;139 140 [self _startSpinning];141 142 _switchingURL = YES;143 144 handler = [[FHHandler alloc] initHandlerWithURL:url];145 146 if(!handler) {147 [self _stopSpinning];148 149 return;150 }151 152 if(_handler) {153 if(![_handler isSynchronous] && ![_handler isFinished])154 [self _stopSpinning];155 156 if([_handler isLocal])157 [_queue removePath:[[_handler URL] path]];158 159 [_handler release];160 }161 162 _handler = handler;163 [_handler setDelegate:self];164 files = [_handler files];165 166 if([_handler isLocal])167 [_queue addPath:[[_handler URL] path] forMode:WIEventFileWrite];168 169 [self _updateLeftStatus];170 [self _updateButtons];171 [self _reloadPathMenu];172 173 if(file) {174 for(i = 0, count = [files count]; i < count; i++) {175 if([[[files objectAtIndex:i] name] isEqualToString:file]) {176 row = i;177 178 break;179 }180 }181 }182 183 select = (row != [_tableView selectedRow]);184 [_tableView reloadData];185 186 if(select) {187 [_tableView selectRow:row byExtendingSelection:NO];188 } else {189 [_loadImageLock lock];190 _selectedRow = row;191 _imageCounter++;192 [_loadImageLock unlockWithCondition:1];193 }194 195 [_tableView scrollRowToVisible:row];196 197 if([_handler isLocal]) {198 [_loadThumbnailsLock lock];199 _thumbnailsCounter++;200 [_loadThumbnailsLock unlockWithCondition:1];201 }202 203 _switchingURL = NO;204 205 if([_handler isSynchronous])206 [self _stopSpinning];207 }208 209 210 211 - (void)_reloadURL:(WIURL *)url {212 NSString *file;213 214 file = [[[self _selectedFile] name] retain];215 [[FHCache cache] dropThumbnailsForURL:url];216 [self _loadURL:url selectFile:file];217 [file release];218 }219 220 221 222 - (void)_loadFile:(FHFile *)file {223 if([file isLoaded]) {224 [self performSelector:@selector(_fileDidLoadImage:) withObject:file];225 } else {226 [_imageView setImage:NULL];227 [self _updateRightStatus];228 }229 }230 231 232 190 233 191 - (void)_loadFileTimer:(NSTimer *)timer { … … 236 194 BOOL next = NO; 237 195 238 [self nextImage:self];196 // [self nextImage:self]; 239 197 240 198 i = [_tableView selectedRow]; … … 256 214 257 215 258 - (void)_loadImageThread:(id)arg {259 NSAutoreleasePool *pool;260 NSArray *files;261 FHImage *image;262 FHFile *file;263 unsigned int i, count, counter, images, row, lastRow, lastCounter;264 265 lastRow = lastCounter = 0;266 267 while(YES) {268 pool = [[NSAutoreleasePool alloc] init];269 270 [_loadImageLock lockWhenCondition:1];271 row = _selectedRow;272 files = [[_handler files] copy];273 counter = _imageCounter;274 [_loadImageLock unlockWithCondition:0];275 276 if(counter != lastCounter) {277 count = [files count];278 279 // --- purge all but the last couple of images280 if(row > FHUnloadImageCount) {281 for(i = 0; i < count && i < row - FHUnloadImageCount; i++) {282 file = [files objectAtIndex:i];283 284 if([file isDirectory])285 continue;286 287 if(![file isLoaded])288 continue;289 290 [file setImage:NULL];291 [file setLoaded:NO];292 }293 }294 295 // --- load the next couple of images296 for(i = row, images = 0; i < count; i++) {297 file = [files objectAtIndex:i];298 299 if([file isDirectory])300 goto next;301 302 if(++images > FHPreloadImageCount)303 break;304 305 if([file image])306 goto next;307 308 image = [[FHImage alloc] initImageWithURL:[file URL]];309 [file setImage:image];310 [file setLoaded:YES];311 [image release];312 313 [self performSelectorOnMainThread:@selector(_fileDidLoadImage:) withObject:file waitUntilDone:YES];314 315 next:316 [_loadImageLock lock];317 if(counter != _imageCounter)318 i = count;319 [_loadImageLock unlockWithCondition:counter == _imageCounter ? 0 : 1];320 }321 322 lastRow = row;323 lastCounter = counter;324 }325 326 [files release];327 [pool release];328 }329 }330 331 332 333 - (void)_loadThumbnailsThread:(id)arg {334 NSAutoreleasePool *pool;335 NSArray *files;336 FHImage *image;337 FHFile *file;338 WIURL *url;339 unsigned int i, count, counter, images;340 341 [NSThread setThreadPriority:0.25];342 343 while(YES) {344 pool = [[NSAutoreleasePool alloc] init];345 346 [_loadThumbnailsLock lockWhenCondition:1];347 files = [[_handler files] copy];348 counter = _thumbnailsCounter;349 [_loadThumbnailsLock unlockWithCondition:0];350 351 count = [files count];352 353 for(i = images = 0; i < count; i++) {354 file = [files objectAtIndex:i];355 356 if([file isDirectory] || [file thumbnail])357 goto next;358 359 url = [file URL];360 361 if(![url isFileURL])362 goto next;363 364 image = [[FHCache cache] thumbnailForURL:url];365 366 if(!image) {367 image = [[FHImage alloc] initThumbnailWithURL:url preferredSize:NSMakeSize(128.0, 128.0)];368 369 if(image)370 [[FHCache cache] setThumbnail:image forURL:url];371 }372 373 if(image) {374 [file setThumbnail:image];375 [image release];376 377 [self performSelectorOnMainThread:@selector(_fileDidLoadThumbnail:) withObject:file waitUntilDone:YES];378 }379 380 next:381 if(++images % 5 == 0) {382 [_loadThumbnailsLock lock];383 if(counter != _thumbnailsCounter)384 i = count;385 [_loadThumbnailsLock unlockWithCondition:counter == _thumbnailsCounter ? 0 : 1];386 }387 }388 389 [files release];390 [pool release];391 }392 }393 394 395 396 - (void)_fileDidLoadImage:(FHFile *)file {397 FHImage *image;398 BOOL success;399 400 image = [file image];401 success = (image && [image size].width > 0.0);402 403 if([file isEqual:[self _sele
