Changeset 13174


Ignore:
Timestamp:
Jan 20, 2012, 2:41:49 AM (10 years ago)
Author:
livings124
Message:

for the fun of it, replace some variables with @property in the file and tracker nodes

Location:
trunk/macosx
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/FileListNode.h

    r13162 r13174  
    2929@interface FileListNode : NSObject <NSCopying>
    3030{
    31     NSString * fName, * fPath;
    32     BOOL fIsFolder;
    3331    NSMutableIndexSet * fIndexes;
    3432   
    35     uint64_t fSize;
    36     NSImage * fIcon;
    37    
    3833    NSMutableArray * fChildren;
    39    
    40     Torrent * fTorrent;
    4134}
     35
     36@property (nonatomic, readonly) NSString * name;
     37@property (nonatomic, readonly) NSString * path;
     38
     39@property (nonatomic, readonly) Torrent * torrent;
     40
     41@property (nonatomic, readonly) uint64_t size;
     42@property (nonatomic, readonly) NSImage * icon;
     43@property (nonatomic, readonly) BOOL isFolder;
    4244
    4345- (id) initWithFolderName: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent;
     
    4951- (NSString *) description;
    5052
    51 - (BOOL) isFolder;
    52 - (NSString *) name;
    53 - (NSString *) path;
    5453- (NSIndexSet *) indexes;
    55 
    56 - (uint64_t) size;
    57 - (NSImage *) icon;
    5854
    5955- (NSMutableArray *) children;
    6056
    61 - (Torrent *) torrent;
    62 
    6357@end
  • trunk/macosx/FileListNode.m

    r13162 r13174  
    3232
    3333@implementation FileListNode
     34
     35@synthesize name = fName;
     36@synthesize path = fPath;
     37@synthesize torrent = fTorrent;
     38@synthesize size = fSize;
     39@synthesize icon = fIcon;
     40@synthesize isFolder = fIsFolder;
    3441
    3542- (id) initWithFolderName: (NSString *) name path: (NSString *) path torrent: (Torrent *) torrent
     
    97104}
    98105
    99 - (BOOL) isFolder
    100 {
    101     return fIsFolder;
    102 }
    103 
    104 - (NSString *) name
    105 {
    106     return fName;
    107 }
    108 
    109 - (NSString *) path
    110 {
    111     return fPath;
    112 }
    113 
    114106- (NSIndexSet *) indexes
    115107{
    116108    return fIndexes;
    117 }
    118 
    119 - (uint64_t) size
    120 {
    121     return fSize;
    122109}
    123110
     
    135122   
    136123    return fChildren;
    137 }
    138 
    139 - (Torrent *) torrent
    140 {
    141     return fTorrent;
    142124}
    143125
  • trunk/macosx/Torrent.m

    r13162 r13174  
    298298   
    299299    fStat = tr_torrentStat(fHandle);
    300 
     300   
    301301    //make sure the "active" filter is updated when stalled-ness changes
    302302    if (wasStalled != [self isStalled])
  • trunk/macosx/TrackerNode.h

    r13162 r13174  
    3131{
    3232    tr_tracker_stat fStat;
    33    
    34     Torrent * fTorrent; //weak reference
    3533}
     34
     35@property (nonatomic, readonly) Torrent * torrent;
    3636
    3737- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent;
     
    4646- (NSUInteger) identifier;
    4747
    48 - (Torrent *) torrent;
    49 
    5048- (NSInteger) totalSeeders;
    5149- (NSInteger) totalLeechers;
  • trunk/macosx/TrackerNode.m

    r13162 r13174  
    2828@implementation TrackerNode
    2929
     30@synthesize torrent = fTorrent;
     31
    3032- (id) initWithTrackerStat: (tr_tracker_stat *) stat torrent: (Torrent *) torrent
    3133{
     
    3335    {
    3436        fStat = *stat;
    35         fTorrent = torrent;
     37        fTorrent = torrent; //weak reference
    3638    }
    3739   
     
    8284{
    8385    return fStat.id;
    84 }
    85 
    86 - (Torrent *) torrent
    87 {
    88     return fTorrent;
    8986}
    9087
Note: See TracChangeset for help on using the changeset viewer.