Changeset 10861
- Timestamp:
- Jun 25, 2010, 10:19:28 PM (12 years ago)
- Location:
- trunk/macosx
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.m
r10559 r10861 1889 1889 Torrent * torrent = [notification object]; 1890 1890 1891 if ([ torrent isActive])1891 if ([[[notification userInfo] objectForKey: @"WasRunning"] boolValue]) 1892 1892 { 1893 1893 if (!fSoundPlaying && [fDefaults boolForKey: @"PlayDownloadSound"]) … … 1919 1919 object: [torrent dataLocation]]; 1920 1920 1921 if ([ fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] == 0)1921 if ([torrent isActive] && [fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] == 0) 1922 1922 { 1923 1923 [torrent stopTransfer]; … … 1932 1932 { 1933 1933 Torrent * torrent = [notification object]; 1934 if ([torrent isActive]) 1935 { 1936 if ([fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0) 1937 { 1938 [torrent stopTransfer]; 1939 [torrent setWaitToStart: YES]; 1940 } 1934 if ([torrent isActive] && [fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] == 0) 1935 { 1936 [torrent stopTransfer]; 1937 [torrent setWaitToStart: YES]; 1941 1938 } 1942 1939 -
trunk/macosx/Torrent.m
r10832 r10861 44 44 index: (NSInteger) index flatList: (NSMutableArray *) flatFileList; 45 45 46 - (void) completenessChange: (NS Number *) status;46 - (void) completenessChange: (NSDictionary *) statusInfo; 47 47 - (void) ratioLimitHit; 48 48 - (void) metadataRetrieved; … … 54 54 @end 55 55 56 void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, void * torrentData) 57 { 58 [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) 59 withObject: [[NSNumber alloc] initWithInt: status] waitUntilDone: NO]; 56 void completenessChangeCallback(tr_torrent * torrent, tr_completeness status, tr_bool wasRunning, void * torrentData) 57 { 58 NSDictionary * dict = [[NSDictionary alloc] initWithObjectsAndKeys: [NSNumber numberWithInt: status], @"Status", 59 [NSNumber numberWithBool: wasRunning], @"WasRunning", nil]; 60 [(Torrent *)torrentData performSelectorOnMainThread: @selector(completenessChange:) withObject: dict waitUntilDone: NO]; 60 61 } 61 62 … … 1744 1745 1745 1746 //status has been retained 1746 - (void) completenessChange: (NS Number *) status1747 - (void) completenessChange: (NSDictionary *) statusInfo 1747 1748 { 1748 1749 fStat = tr_torrentStat(fHandle); //don't call update yet to avoid auto-stop 1749 1750 1750 switch ([ statusintValue])1751 switch ([[statusInfo objectForKey: @"Status"] intValue]) 1751 1752 { 1752 1753 case TR_SEED: 1753 1754 case TR_PARTIAL_SEED: 1754 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self]; 1755 //simpler to create a new dictionary than to use statusInfo - avoids retention chicanery 1756 [[NSNotificationCenter defaultCenter] postNotificationName: @"TorrentFinishedDownloading" object: self 1757 userInfo: [NSDictionary dictionaryWithObject: [statusInfo objectForKey: @"WasRunning"] forKey: @"WasRunning"]]; 1755 1758 break; 1756 1759 … … 1759 1762 break; 1760 1763 } 1761 [status release];1764 [statusInfo release]; 1762 1765 1763 1766 [self update];
Note: See TracChangeset
for help on using the changeset viewer.