Changeset 9312
- Timestamp:
- Oct 16, 2009, 11:02:55 PM (13 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/Controller.h
r9302 r9312 187 187 188 188 - (void) updateTorrentsInQueue; 189 - (NS Integer) numToStartFromQueue: (BOOL) downloadQueue;189 - (NSUInteger) numToStartFromQueue: (BOOL) downloadQueue; 190 190 191 191 - (void) torrentFinishedDownloading: (NSNotification *) notification; -
trunk/macosx/Controller.m
r9309 r9312 1689 1689 - (void) updateTorrentsInQueue 1690 1690 { 1691 BOOL download = [fDefaults boolForKey: @"Queue"], 1692 seed = [fDefaults boolForKey: @"QueueSeed"]; 1693 1694 NSInteger desiredDownloadActive = [self numToStartFromQueue: YES], 1695 desiredSeedActive = [self numToStartFromQueue: NO]; 1691 NSUInteger desiredDownloadActive = [fDefaults boolForKey: @"Queue"] ? [self numToStartFromQueue: YES] : NSUIntegerMax, 1692 desiredSeedActive = [fDefaults boolForKey: @"QueueSeed"] ? [self numToStartFromQueue: NO] : NSUIntegerMax; 1696 1693 1697 1694 for (Torrent * torrent in fTorrents) 1698 1695 { 1696 if (desiredDownloadActive == 0 && desiredSeedActive == 0) 1697 break; 1698 1699 1699 if (![torrent isActive] && ![torrent isChecking] && [torrent waitingToStart]) 1700 1700 { 1701 1701 if (![torrent allDownloaded]) 1702 1702 { 1703 if ( !download ||desiredDownloadActive > 0)1703 if (desiredDownloadActive > 0) 1704 1704 { 1705 1705 [torrent startTransfer]; 1706 1706 if ([torrent isActive]) 1707 desiredDownloadActive--;1707 --desiredDownloadActive; 1708 1708 [torrent update]; 1709 1709 } … … 1711 1711 else 1712 1712 { 1713 if ( !seed ||desiredSeedActive > 0)1713 if (desiredSeedActive > 0) 1714 1714 { 1715 1715 [torrent startTransfer]; 1716 1716 if ([torrent isActive]) 1717 desiredSeedActive--;1717 --desiredSeedActive; 1718 1718 [torrent update]; 1719 1719 } … … 1727 1727 } 1728 1728 1729 - (NS Integer) numToStartFromQueue: (BOOL) downloadQueue1729 - (NSUInteger) numToStartFromQueue: (BOOL) downloadQueue 1730 1730 { 1731 1731 if (![fDefaults boolForKey: downloadQueue ? @"Queue" : @"QueueSeed"]) 1732 1732 return 0; 1733 1733 1734 NS Integer desired = [fDefaults integerForKey: downloadQueue ? @"QueueDownloadNumber" : @"QueueSeedNumber"];1734 NSUInteger desired = [fDefaults integerForKey: downloadQueue ? @"QueueDownloadNumber" : @"QueueSeedNumber"]; 1735 1735 1736 1736 for (Torrent * torrent in fTorrents) 1737 1737 { 1738 if (desired == 0) 1739 break; 1740 1738 1741 if ([torrent isChecking]) 1739 { 1740 desired--; 1741 if (desired <= 0) 1742 return 0; 1743 } 1742 --desired; 1744 1743 else if ([torrent isActive] && ![torrent isStalled] && ![torrent isError]) 1745 1744 { 1746 1745 if ([torrent allDownloaded] != downloadQueue) 1747 { 1748 desired--; 1749 if (desired <= 0) 1750 return 0; 1751 } 1746 --desired; 1752 1747 } 1753 1748 else; … … 1787 1782 object: [[torrent downloadFolder] stringByAppendingPathComponent: [torrent name]]]; 1788 1783 1789 if ([ fDefaults boolForKey: @"QueueSeed"] && [self numToStartFromQueue: NO] <= 0)1784 if ([self numToStartFromQueue: NO] == 0) 1790 1785 { 1791 1786 [torrent stopTransfer]; … … 1802 1797 if ([torrent isActive]) 1803 1798 { 1804 if ([ fDefaults boolForKey: @"Queue"] && [self numToStartFromQueue: YES] <= 0)1799 if ([self numToStartFromQueue: YES] == 0) 1805 1800 { 1806 1801 [torrent stopTransfer]; … … 3569 3564 default: 3570 3565 NSAssert1(NO, @"Unknown sort tag received: %d", [menuItem tag]); 3571 return ;3566 return NO; 3572 3567 } 3573 3568 -
trunk/macosx/en.lproj/Localizable.strings
r9310 r9312 720 720 "Resume the transfer right away" = "Resume the transfer right away"; 721 721 722 /* Torrent cell -> button info */723 "Reveal the data file in Finder" = "Reveal the data file in Finder";724 725 722 /* Stats window -> label */ 726 723 "Running Time" = "Running Time"; … … 791 788 "Show Status Bar" = "Show Status Bar"; 792 789 790 /* Torrent cell -> button info */ 791 "Show the data file in Finder" = "Show the data file in Finder"; 792 793 793 /* Status Bar -> speed tooltip */ 794 794 "Speed Limit" = "Speed Limit";
Note: See TracChangeset
for help on using the changeset viewer.