Changeset 2935
- Timestamp:
- 05/30/05 23:00:39 (4 years ago)
- Files:
-
- Footagehead/trunk/FHAtomHandler.h (added)
- Footagehead/trunk/FHAtomHandler.m (added)
- Footagehead/trunk/FHAtomStreamParser.h (deleted)
- Footagehead/trunk/FHAtomStreamParser.m (deleted)
- Footagehead/trunk/FHCache.h (modified) (1 diff)
- Footagehead/trunk/FHCache.m (modified) (4 diffs)
- Footagehead/trunk/FHFeedHandler.h (added)
- Footagehead/trunk/FHFeedHandler.m (added)
- Footagehead/trunk/FHFile.m (modified) (1 diff)
- Footagehead/trunk/FHFlickrHandler.h (deleted)
- Footagehead/trunk/FHFlickrHandler.m (deleted)
- Footagehead/trunk/FHHandler.h (modified) (1 diff)
- Footagehead/trunk/FHHandler.m (modified) (4 diffs)
- Footagehead/trunk/FHRSSHandler.h (added)
- Footagehead/trunk/FHRSSHandler.m (added)
- Footagehead/trunk/FHRSSStreamParser.h (deleted)
- Footagehead/trunk/FHRSSStreamParser.m (deleted)
- Footagehead/trunk/FHStreamParser.h (deleted)
- Footagehead/trunk/FHStreamParser.m (deleted)
- Footagehead/trunk/FHURLHandler.m (modified) (3 diffs)
- Footagehead/trunk/Footagehead.xcode/project.pbxproj (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Footagehead/trunk/FHCache.h
r2887 r2935 43 43 - (NSImage *)fileIconForExtension:(NSString *)extension; 44 44 45 - (void)setFileIcon:(NSImage *)icon for Path:(NSString *)extension;46 - (NSImage *)fileIconFor Path:(NSString *)path;45 - (void)setFileIcon:(NSImage *)icon forURL:(ZAURL *)url; 46 - (NSImage *)fileIconForURL:(ZAURL *)url; 47 47 48 48 - (void)addTemporaryPath:(NSString *)path; Footagehead/trunk/FHCache.m
r920 r2935 1 /* $Id : FHCache.m,v 1.5 2005/01/08 22:55:46 morris Exp$ */1 /* $Id$ */ 2 2 3 3 /* … … 107 107 #pragma mark - 108 108 109 - (void)setFileIcon:(NSImage *)icon for Path:(NSString *)path{109 - (void)setFileIcon:(NSImage *)icon forURL:(ZAURL *)url { 110 110 [_lock lock]; 111 111 … … 113 113 [_fileIcons removeObjectForKey:[[_fileIcons allKeys] objectAtIndex:0]]; 114 114 115 [_fileIcons setObject:icon forKey: path];115 [_fileIcons setObject:icon forKey:url]; 116 116 117 117 [_lock unlock]; … … 120 120 121 121 122 - (NSImage *)fileIconFor Path:(NSString *)path{122 - (NSImage *)fileIconForURL:(ZAURL *)url { 123 123 NSImage *image; 124 124 125 125 [_lock lock]; 126 image = [_fileIcons objectForKey: path];126 image = [_fileIcons objectForKey:url]; 127 127 [_lock unlock]; 128 128 Footagehead/trunk/FHFile.m
r2919 r2935 63 63 } else { 64 64 // --- get icon for local directory path 65 _icon = [[FHCache cache] fileIconFor Path:_path];65 _icon = [[FHCache cache] fileIconForURL:url]; 66 66 67 67 if(!_icon) { 68 68 _icon = [[NSWorkspace sharedWorkspace] iconForFile:_path]; 69 69 70 [[FHCache cache] setFileIcon:_icon for Path:_path];70 [[FHCache cache] setFileIcon:_icon forURL:_url]; 71 71 } 72 72 } Footagehead/trunk/FHHandler.h
r2933 r2935 32 32 NSMutableArray *_files; 33 33 ZAURL *_url; 34 34 35 NSImage *_icon; 36 35 37 id _delegate; 36 38 Footagehead/trunk/FHHandler.m
r2933 r2935 31 31 #import "FHHandler.h" 32 32 #import "FHFileHandler.h" 33 #import "FHFlickrHandler.h"34 33 #import "FHImageHandler.h" 35 34 #import "FHRangeHandler.h" … … 45 44 FHHandlerClasses = [[NSArray alloc] initWithObjects: 46 45 [FHFileHandler class], 47 [FHFlickrHandler class],48 46 [FHRangeHandler class], 49 47 [FHSpotlightHandler class], … … 95 93 [_url release]; 96 94 [_files release]; 95 [_icon release]; 97 96 98 97 [super dealloc]; … … 253 252 - (NSImage *)iconForURL:(ZAURL *)url { 254 253 NSImage *icon; 255 NSString *path;256 257 i f(![url isFileURL]) {258 icon = [NSImage imageNamed:@"URL"];259 } else{260 path = [url path];261 icon = [[FHCache cache] fileIconForPath:path];262 263 if(!icon) {264 icon = [[NSWorkspace sharedWorkspace] iconForFile:path];254 ZAURL *faviconURL; 255 256 icon = [[FHCache cache] fileIconForURL:url]; 257 258 if(!icon) { 259 if([url isFileURL]) { 260 icon = [[NSWorkspace sharedWorkspace] iconForFile:[url path]]; 261 } else { 262 faviconURL = [[url copy] autorelease]; 263 [faviconURL setPath:@"/favicon.ico"]; 265 264 266 [[FHCache cache] setFileIcon:icon forPath:path]; 265 icon = [[[NSImage alloc] initWithContentsOfURL:[faviconURL URL]] autorelease]; 266 267 if(!icon) 268 icon = [NSImage imageNamed:@"URL"]; 267 269 } 268 } 269 270 271 [[FHCache cache] setFileIcon:icon forURL:url]; 272 } 273 270 274 return icon; 271 275 } Footagehead/trunk/FHURLHandler.m
r2933 r2935 27 27 */ 28 28 29 #import "FHURLHandler.h" 29 30 #import "FHHTMLHandler.h" 30 31 #import "FHImageHandler.h" 31 #import "FH URLHandler.h"32 #import "FHRSSHandler.h" 32 33 33 34 @implementation FHURLHandler … … 83 84 84 85 if([mime isEqualToString:@"text/html"]) { 85 NSString * html, *encodingName;86 NSString *text, *encodingName; 86 87 NSStringEncoding nsEncoding; 87 88 CFStringEncoding cfEncoding; … … 92 93 if(encodingName) { 93 94 cfEncoding = CFStringConvertIANACharSetNameToEncoding((CFStringRef) encodingName); 94 95 if(cfEncoding != kCFStringEncodingInvalidId)96 nsEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding);95 96 if(cfEncoding != kCFStringEncodingInvalidId) 97 nsEncoding = CFStringConvertEncodingToNSStringEncoding(cfEncoding); 97 98 } 98 99 99 html= [NSString stringWithData:data encoding:nsEncoding];100 text = [NSString stringWithData:data encoding:nsEncoding]; 100 101 101 return [[FHHTMLHandler allocWithZone:zone] initHandlerWithURL:url HTML:html]; 102 return [[FHHTMLHandler allocWithZone:zone] initHandlerWithURL:url HTML:text]; 103 } 104 else if([mime containsSubstring:@"xml"]) { 105 CFXMLTreeRef feed; 106 107 feed = CFXMLTreeCreateFromData(kCFAllocatorDefault, (CFDataRef) data, 108 NULL, kCFXMLParserSkipWhitespace, 109 kCFXMLNodeCurrentVersion); 110 111 if(feed) { 112 if([mime isEqualToString:@"text/xml"]) { 113 Class handler; 114 115 handler = [FHFeedHandler handlerForFeed:feed]; 116 117 return [[handler allocWithZone:zone] initHandlerWithURL:url feed:feed]; 118 } 119 else if([mime isEqualToString:@"application/rss+xml"]) { 120 return [[FHRSSHandler allocWithZone:zone] initHandlerWithURL:url feed:feed]; 121 } 122 } 102 123 } 103 124 else if([mime hasPrefix:@"image/"]) { Footagehead/trunk/Footagehead.xcode/project.pbxproj
r2933 r2935 135 135 A5B1F60D067B3A8000111D0A, 136 136 A5B1F7B9067B43C300111D0A, 137 A5E7CC4B0848B02B00F1E98C,138 137 A5EE94DA055AA5EE00CC2AD8, 139 138 29B97315FDCFA39411CA2CEA, … … 1454 1453 77EAADD8084B546D006C9F69, 1455 1454 77EAADD9084B546D006C9F69, 1455 A519AA10084BA8FB00EFF2EA, 1456 1456 A5B1F9AA067BCF0100111D0A, 1457 1457 A5B1F9A9067BCF0100111D0A, … … 1559 1559 770EBFC5083C94CE0094BD6C, 1560 1560 775BA4F2075F70ED00F0941E, 1561 A5E7CC520848B05300F1E98C,1562 1561 A5B1FB9F067CB90400111D0A, 1563 1562 A587DF83055AA418005D2097, … … 1565 1564 A599A110075F94F400A03BA5, 1566 1565 A5B1F617067B3B7900111D0A, 1567 A5E7C99E0847C61400F1E98C,1568 1566 A5B1F611067B3AA100111D0A, 1569 1567 A5B1F9AC067BCF0200111D0A, … … 1573 1571 A54BD5420566834700E3ACBC, 1574 1572 A5B1F9C1067BDF2300111D0A, 1575 A5E7CA4E0847CBA000F1E98C,1576 1573 A587DF85055AA418005D2097, 1577 A5E7CC610848B09000F1E98C,1578 1574 A5092F57083E7812006646D1, 1579 1575 77BD99520760B7380007D034, 1576 A519AA0A084BA8C900EFF2EA, 1577 A519AA34084BA91B00EFF2EA, 1578 A519AA6A084BAC2800EFF2EA, 1580 1579 ); 1581 1580 isa = PBXSourcesBuildPhase; … … 1702 1701 shellScript = "#!/bin/sh\n\nPATH=\"/usr/local/bin:$PATH\" perl version.pl\n\nexit 0"; 1703 1702 }; 1703 A519AA07084BA8C900EFF2EA = { 1704 fileEncoding = 5; 1705 isa = PBXFileReference; 1706 lastKnownFileType = sourcecode.c.h; 1707 path = FHRSSHandler.h; 1708 refType = 4; 1709 sourceTree = "<group>"; 1710 }; 1711 A519AA08084BA8C900EFF2EA = { 1712 fileEncoding = 5; 1713 isa = PBXFileReference; 1714 lastKnownFileType = sourcecode.c.objc; 1715 path = FHRSSHandler.m; 1716 refType = 4; 1717 sourceTree = "<group>"; 1718 }; 1719 A519AA09084BA8C900EFF2EA = { 1720 fileRef = A519AA07084BA8C900EFF2EA; 1721 isa = PBXBuildFile; 1722 settings = { 1723 }; 1724 }; 1725 A519AA0A084BA8C900EFF2EA = { 1726 fileRef = A519AA08084BA8C900EFF2EA; 1727 isa = PBXBuildFile; 1728 settings = { 1729 }; 1730 }; 1731 A519AA10084BA8FB00EFF2EA = { 1732 children = ( 1733 A519AA32084BA91B00EFF2EA, 1734 A519AA33084BA91B00EFF2EA, 1735 A519AA68084BAC2800EFF2EA, 1736 A519AA69084BAC2800EFF2EA, 1737 A519AA08084BA8C900EFF2EA, 1738 A519AA07084BA8C900EFF2EA, 1739 ); 1740 isa = PBXGroup; 1741 name = "Feed Handlers"; 1742 refType = 4; 1743 sourceTree = "<group>"; 1744 }; 1745 A519AA32084BA91B00EFF2EA = { 1746 fileEncoding = 5; 1747 isa = PBXFileReference; 1748 lastKnownFileType = sourcecode.c.objc; 1749 path = FHFeedHandler.m; 1750 refType = 4; 1751 sourceTree = "<group>"; 1752 }; 1753 A519AA33084BA91B00EFF2EA = { 1754 fileEncoding = 5; 1755 isa = PBXFileReference; 1756 lastKnownFileType = sourcecode.c.h; 1757 path = FHFeedHandler.h; 1758 refType = 4; 1759 sourceTree = "<group>"; 1760 }; 1761 A519AA34084BA91B00EFF2EA = { 1762 fileRef = A519AA32084BA91B00EFF2EA; 1763 isa = PBXBuildFile; 1764 settings = { 1765 }; 1766 }; 1767 A519AA35084BA91B00EFF2EA = { 1768 fileRef = A519AA33084BA91B00EFF2EA; 1769 isa = PBXBuildFile; 1770 settings = { 1771 }; 1772 }; 1773 A519AA68084BAC2800EFF2EA = { 1774 fileEncoding = 5; 1775 isa = PBXFileReference; 1776 lastKnownFileType = sourcecode.c.objc; 1777 path = FHAtomHandler.m; 1778 refType = 4; 1779 sourceTree = "<group>"; 1780 }; 1781 A519AA69084BAC2800EFF2EA = { 1782 fileEncoding = 5; 1783 isa = PBXFileReference; 1784 lastKnownFileType = sourcecode.c.h; 1785 path = FHAtomHandler.h; 1786 refType = 4; 1787 sourceTree = "<group>"; 1788 }; 1789 A519AA6A084BAC2800EFF2EA = { 1790 fileRef = A519AA68084BAC2800EFF2EA; 1791 isa = PBXBuildFile; 1792 settings = { 1793 }; 1794 }; 1795 A519AA6B084BAC2800EFF2EA = { 1796 fileRef = A519AA69084BAC2800EFF2EA; 1797 isa = PBXBuildFile; 1798 settings = { 1799 }; 1800 }; 1704 1801 A52141F605CC26C800861556 = { 1705 1802 isa = PBXFileReference; … … 1945 2042 files = ( 1946 2043 A54D42DD07663AA300227EBE, 2044 A519AA09084BA8C900EFF2EA, 2045 A519AA35084BA91B00EFF2EA, 2046 A519AA6B084BAC2800EFF2EA, 1947 2047 ); 1948 2048 isa = PBXCopyFilesBuildPhase; … … 1977 2077 A5B1F616067B3B7900111D0A, 1978 2078 A5B1F614067B3B6F00111D0A, 1979 A5E7C99C0847C61400F1E98C,1980 A5E7C99B0847C61400F1E98C,1981 2079 A5B1F9BF067BDF2300111D0A, 1982 2080 A5B1F9C0067BDF2300111D0A, … … 2247 2345 }; 2248 2346 }; 2249 A5E7C99B0847C61400F1E98C = {2250 fileEncoding = 5;2251 isa = PBXFileReference;2252 lastKnownFileType = sourcecode.c.h;2253 path = FHFlickrHandler.h;2254 refType = 4;2255 sourceTree = "<group>";2256 };2257 A5E7C99C0847C61400F1E98C = {2258 fileEncoding = 5;2259 isa = PBXFileReference;2260 lastKnownFileType = sourcecode.c.objc;2261 path = FHFlickrHandler.m;2262 refType = 4;2263 sourceTree = "<group>";2264 };2265 A5E7C99E0847C61400F1E98C = {2266 fileRef = A5E7C99C0847C61400F1E98C;2267 isa = PBXBuildFile;2268 settings = {2269 };2270 };2271 A5E7CA4C0847CBA000F1E98C = {2272 fileEncoding = 5;2273 isa = PBXFileReference;2274 lastKnownFileType = sourcecode.c.objc;2275 path = FHRSSStreamParser.m;2276 refType = 4;2277 sourceTree = "<group>";2278 };2279 A5E7CA4D0847CBA000F1E98C = {2280 fileEncoding = 5;2281 isa = PBXFileReference;2282 lastKnownFileType = sourcecode.c.h;2283 path = FHRSSStreamParser.h;2284 refType = 4;2285 sourceTree = "<group>";2286 };2287 A5E7CA4E0847CBA000F1E98C = {2288 fileRef = A5E7CA4C0847CBA000F1E98C;2289 isa = PBXBuildFile;2290 settings = {2291 };2292 };2293 2347 A5E7CC3A0847E7C900F1E98C = { 2294 2348 isa = PBXFileReference; … … 2300 2354 A5E7CC3B0847E7C900F1E98C = { 2301 2355 fileRef = A5E7CC3A0847E7C900F1E98C; 2302 isa = PBXBuildFile;2303 settings = {2304 };2305 };2306 A5E7CC4B0848B02B00F1E98C = {2307 children = (2308 A5E7CC5F0848B09000F1E98C,2309 A5E7CC600848B09000F1E98C,2310 A5E7CC500848B05300F1E98C,2311 A5E7CC4F0848B05300F1E98C,2312 A5E7CA4C0847CBA000F1E98C,2313 A5E7CA4D0847CBA000F1E98C,2314 );2315 isa = PBXGroup;2316 name = Streams;2317 refType = 4;2318 sourceTree = "<group>";2319 };2320 A5E7CC4F0848B05300F1E98C = {2321 fileEncoding = 5;2322 isa = PBXFileReference;2323 lastKnownFileType = sourcecode.c.h;2324 path = FHAtomStreamParser.h;2325 refType = 4;2326 sourceTree = "<group>";2327 };2328 A5E7CC500848B05300F1E98C = {2329 fileEncoding = 5;2330 isa = PBXFileReference;2331 lastKnownFileType = sourcecode.c.objc;2332 path = FHAtomStreamParser.m;2333 refType = 4;2334 sourceTree = "<group>";2335 };2336 A5E7CC520848B05300F1E98C = {2337 fileRef = A5E7CC500848B05300F1E98C;2338 isa = PBXBuildFile;2339 settings = {2340 };2341 };2342 A5E7CC5F0848B09000F1E98C = {2343 fileEncoding = 5;2344 isa = PBXFileReference;2345 lastKnownFileType = sourcecode.c.objc;2346 path = FHStreamParser.m;2347 refType = 4;2348 sourceTree = "<group>";2349 };2350 A5E7CC600848B09000F1E98C = {2351 fileEncoding = 5;2352 isa = PBXFileReference;2353 lastKnownFileType = sourcecode.c.h;2354 path = FHStreamParser.h;2355 refType = 4;2356 sourceTree = "<group>";2357 };2358 A5E7CC610848B09000F1E98C = {2359 fileRef = A5E7CC5F0848B09000F1E98C;2360 2356 isa = PBXBuildFile; 2361 2357 settings = {
