Changeset 9277
- Timestamp:
- Oct 10, 2009, 7:55:47 PM (13 years ago)
- Location:
- trunk/macosx
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/macosx/InfoWindowController.m
r9267 r9277 1440 1440 Torrent * torrent = [fTorrents objectAtIndex: 0]; 1441 1441 1442 #warning still update unselected rows1443 1442 //get update tracker stats 1444 1443 if ([fTrackerTable editedRow] == -1) … … 1705 1704 { 1706 1705 const NSInteger oldCount = [fTrackers count] - [(TrackerNode *)[fTrackers lastObject] tier]; 1707 NSMutable Array * addresses = [NSMutableArray arrayWithCapacity: oldCount];1706 NSMutableSet * addresses = [NSMutableSet setWithCapacity: oldCount]; 1708 1707 1709 1708 NSIndexSet * indexes = [fTrackerTable selectedRowIndexes]; -
trunk/macosx/Torrent.h
r9269 r9277 133 133 - (NSMutableArray *) allTrackersFlat; //used by GroupRules 134 134 - (BOOL) addTrackerToNewTier: (NSString *) tracker; 135 - (void) removeTrackersWithAnnounceAddresses: (NS Array*) trackers;135 - (void) removeTrackersWithAnnounceAddresses: (NSSet *) trackers; 136 136 137 137 - (NSString *) comment; -
trunk/macosx/Torrent.m
r9227 r9277 706 706 } 707 707 708 #warning check for duplicates?709 708 - (BOOL) addTrackerToNewTier: (NSString *) tracker 710 709 { … … 713 712 if ([tracker rangeOfString: @"://"].location == NSNotFound) 714 713 tracker = [@"http://" stringByAppendingString: tracker]; 715 716 if (!tr_httpIsValidURL([tracker UTF8String]))717 return NO;718 714 719 715 //recreate the tracker structure … … 726 722 trackerStructs[oldTrackerCount].tier = trackerStructs[oldTrackerCount-1].tier + 1; 727 723 728 tr_torrentSetAnnounceList(fHandle, trackerStructs, oldTrackerCount+1);724 const tr_announce_list_err result = tr_torrentSetAnnounceList(fHandle, trackerStructs, oldTrackerCount+1); 729 725 tr_free(trackerStructs); 730 726 731 return YES;732 } 733 734 - (void) removeTrackersWithAnnounceAddresses: (NS Array*) trackers727 return result == TR_ANNOUNCE_LIST_OK; 728 } 729 730 - (void) removeTrackersWithAnnounceAddresses: (NSSet *) trackers 735 731 { 736 732 //recreate the tracker structure … … 741 737 for (NSInteger oldIndex = 0; oldIndex < oldTrackerCount; ++newCount, ++oldIndex) 742 738 { 743 if (![trackers containsObject: [NSString stringWithUTF8String: fInfo->trackers[oldIndex].announce]])739 if (![trackers member: [NSString stringWithUTF8String: fInfo->trackers[oldIndex].announce]]) 744 740 trackerStructs[newCount] = fInfo->trackers[oldIndex]; 745 741 else … … 747 743 } 748 744 749 tr_torrentSetAnnounceList(fHandle, trackerStructs, newCount); 745 const tr_announce_list_err result = tr_torrentSetAnnounceList(fHandle, trackerStructs, newCount); 746 NSAssert1(result == TR_ANNOUNCE_LIST_OK, @"Removing tracker addresses resulted in error: %d", result); 747 750 748 tr_free(trackerStructs); 751 749 }
Note: See TracChangeset
for help on using the changeset viewer.