Changeset 14119
- Timestamp:
- Jul 14, 2013, 2:35:57 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Torrent.m
r14118 r14119 50 50 51 51 - (void) startQueue; 52 - (void) completenessChange: ( NSDictionary *) statusInfo;52 - (void) completenessChange: (tr_completeness) status wasRunning: (BOOL) wasRunning; 53 53 - (void) ratioLimitHit; 54 54 - (void) idleLimitHit; … … 73 73 { 74 74 dispatch_async(dispatch_get_main_queue(), ^{ 75 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status", 76 [NSNumber numberWithBool: wasRunning], @"WasRunning", nil]; 77 [(Torrent *)torrentData completenessChange: dict]; 75 [(Torrent *)torrentData completenessChange: status wasRunning: wasRunning]; 78 76 }); 79 77 } … … 1827 1825 1828 1826 //status has been retained 1829 - (void) completenessChange: ( NSDictionary *) statusInfo1827 - (void) completenessChange: (tr_completeness) status wasRunning: (BOOL) wasRunning 1830 1828 { 1831 1829 fStat = tr_torrentStat(fHandle); //don't call update yet to avoid auto-stop 1832 1830 1833 switch ( [[statusInfo objectForKey: @"Status"] intValue])1831 switch (status) 1834 1832 { 1835 1833 case TR_SEED: 1836 1834 case TR_PARTIAL_SEED: 1837 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self userInfo: [[statusInfo retain] autorelease]]; 1835 { 1836 NSDictionary * statusInfo = @{ @"Status" : @(status), @"WasRunning" : @(wasRunning) }; 1837 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self userInfo: statusInfo]; 1838 1838 1839 1839 //quarantine the finished data … … 1850 1850 1851 1851 break; 1852 1852 } 1853 1853 case TR_LEECH: 1854 1854 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentRestartedDownloading" object: self]; 1855 1855 break; 1856 1856 } 1857 [statusInfo release];1858 1857 1859 1858 [self update];
Note: See TracChangeset
for help on using the changeset viewer.