Changeset 12483
- Timestamp:
- May 31, 2011, 10:26:04 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/FileListNode.h
r12453 r12483 25 25 #import <Cocoa/Cocoa.h> 26 26 27 @class Torrent; 28 27 29 @interface FileListNode : NSObject <NSCopying> 28 30 { … … 35 37 36 38 NSMutableArray * fChildren; 39 40 Torrent * fTorrent; 37 41 } 38 42 39 - (id) initWithFolderName: (NSString *) name path: (NSString *) path ;40 - (id) initWithFileName: (NSString *) name path: (NSString *) path size: (uint64_t) size index: (NSUInteger) index ;43 - (id) initWithFolderName: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent; 44 - (id) initWithFileName: (NSString *) name path: (NSString *) path size: (uint64_t) size index: (NSUInteger) index torrent: (Torrent *) torrent; 41 45 42 46 - (void) insertChild: (FileListNode *) child; … … 55 59 - (NSMutableArray *) children; 56 60 61 - (Torrent *) torrent; 62 57 63 @end -
trunk/macosx/FileListNode.m
r12453 r12483 27 27 @interface FileListNode (Private) 28 28 29 - (id) initWithFolder: (BOOL) isFolder name: (NSString *) name path: (NSString *) path ;29 - (id) initWithFolder: (BOOL) isFolder name: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent; 30 30 31 31 @end … … 33 33 @implementation FileListNode 34 34 35 - (id) initWithFolderName: (NSString *) name path: (NSString *) path 35 - (id) initWithFolderName: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent 36 36 { 37 if ((self = [self initWithFolder: YES name: name path: path ]))37 if ((self = [self initWithFolder: YES name: name path: path torrent: torrent])) 38 38 { 39 39 fChildren = [[NSMutableArray alloc] init]; … … 44 44 } 45 45 46 - (id) initWithFileName: (NSString *) name path: (NSString *) path size: (uint64_t) size index: (NSUInteger) index 46 - (id) initWithFileName: (NSString *) name path: (NSString *) path size: (uint64_t) size index: (NSUInteger) index torrent: (Torrent *) torrent 47 47 { 48 if ((self = [self initWithFolder: NO name: name path: path ]))48 if ((self = [self initWithFolder: NO name: name path: path torrent: torrent])) 49 49 { 50 50 fSize = size; … … 137 137 } 138 138 139 - (Torrent *) torrent 140 { 141 return fTorrent; 142 } 143 139 144 @end 140 145 141 146 @implementation FileListNode (Private) 142 147 143 - (id) initWithFolder: (BOOL) isFolder name: (NSString *) name path: (NSString *) path 148 - (id) initWithFolder: (BOOL) isFolder name: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent 144 149 { 145 150 if ((self = [super init])) … … 150 155 151 156 fIndexes = [[NSMutableIndexSet alloc] init]; 157 158 fTorrent = torrent; 152 159 } 153 160 -
trunk/macosx/FileNameCell.m
r11617 r12483 130 130 if ([self backgroundStyle] == NSBackgroundStyleDark) 131 131 titleColor = statusColor = [NSColor whiteColor]; 132 else if ([[(File OutlineView *)[self controlView] torrent] checkForFiles: [(FileListNode *)[self objectValue] indexes]] == NSOffState)132 else if ([[(FileListNode *)[self objectValue] torrent] checkForFiles: [(FileListNode *)[self objectValue] indexes]] == NSOffState) 133 133 titleColor = statusColor = [NSColor disabledControlTextColor]; 134 134 else … … 208 208 - (NSAttributedString *) attributedStatus 209 209 { 210 Torrent * torrent = [(FileOutlineView *)[self controlView] torrent];211 210 FileListNode * node = (FileListNode *)[self objectValue]; 211 Torrent * torrent = [node torrent]; 212 212 213 213 const CGFloat progress = [torrent fileProgress: node]; -
trunk/macosx/FileOutlineController.m
r12433 r12483 85 85 { 86 86 fTorrent = torrent; 87 [fOutline setTorrent: fTorrent];88 87 89 88 [fFileList release]; -
trunk/macosx/FileOutlineView.h
r12474 r12483 29 29 @interface FileOutlineView : NSOutlineView 30 30 { 31 Torrent * fTorrent;32 33 31 NSInteger fMouseRow; 34 32 } 35 36 - (void) setTorrent: (Torrent *) torrent;37 - (Torrent *) torrent;38 33 39 34 - (NSRect) iconRectForRow: (int) row; -
trunk/macosx/FileOutlineView.m
r12474 r12483 53 53 { 54 54 [super dealloc]; 55 }56 57 #warning needed?58 - (void) setTorrent: (Torrent *) torrent59 {60 fTorrent = torrent;61 }62 63 - (Torrent *) torrent64 {65 return fTorrent;66 55 } 67 56 -
trunk/macosx/FilePriorityCell.m
r12473 r12483 82 82 } 83 83 84 Torrent * torrent = [(FileListNode *)[self representedObject] torrent]; 85 [torrent setFilePriority: priority forIndexes: [(FileListNode *)[self representedObject] indexes]]; 86 84 87 FileOutlineView * controlView = (FileOutlineView *)[self controlView]; 85 Torrent * torrent = [controlView torrent];86 [torrent setFilePriority: priority forIndexes: [(FileListNode *)[self representedObject] indexes]];87 88 [controlView reloadData]; 88 89 } … … 111 112 - (void) drawWithFrame: (NSRect) cellFrame inView: (NSView *) controlView 112 113 { 113 Torrent * torrent = [(FileOutlineView *)controlView torrent];114 114 FileListNode * node = [self representedObject]; 115 Torrent * torrent = [node torrent]; 115 116 NSSet * priorities = [torrent filePrioritiesForIndexes: [node indexes]]; 116 117 -
trunk/macosx/Torrent.m
r12325 r12483 1719 1719 if (!node) 1720 1720 { 1721 node = [[FileListNode alloc] initWithFolderName: name path: path ];1721 node = [[FileListNode alloc] initWithFolderName: name path: path torrent: self]; 1722 1722 [fileList addObject: node]; 1723 1723 [node release]; … … 1732 1732 else 1733 1733 { 1734 FileListNode * node = [[FileListNode alloc] initWithFileName: name path: path size: file->length index: i ];1734 FileListNode * node = [[FileListNode alloc] initWithFileName: name path: path size: file->length index: i torrent: self]; 1735 1735 [fileList addObject: node]; 1736 1736 [flatFileList addObject: node]; … … 1747 1747 else 1748 1748 { 1749 FileListNode * node = [[FileListNode alloc] initWithFileName: [self name] path: @"" size: [self size] index: 0 ];1749 FileListNode * node = [[FileListNode alloc] initWithFileName: [self name] path: @"" size: [self size] index: 0 torrent: self]; 1750 1750 fFileList = [[NSArray arrayWithObject: node] retain]; 1751 1751 fFlatFileList = [fFileList retain]; … … 1773 1773 NSString * path = [[parent path] stringByAppendingPathComponent: [parent name]]; 1774 1774 if (isFolder) 1775 node = [[FileListNode alloc] initWithFolderName: name path: path ];1775 node = [[FileListNode alloc] initWithFolderName: name path: path torrent: self]; 1776 1776 else 1777 1777 { 1778 node = [[FileListNode alloc] initWithFileName: name path: path size: size index: index ];1778 node = [[FileListNode alloc] initWithFileName: name path: path size: size index: index torrent: self]; 1779 1779 [flatFileList addObject: node]; 1780 1780 }
Note: See TracChangeset
for help on using the changeset viewer.