NSGradient * fHighPriorityGradient, * fLowPriorityGradient, * fMixedPriorityGradient;
- int fMouseRow;
+ NSInteger fMouseRow;
}
- (void) setTorrent: (Torrent *) torrent;
- (NSRect) iconRectForRow: (int) row;
-- (int) hoveredRow;
+- (NSInteger) hoveredRow;
@end
- (NSMenu *) menuForEvent: (NSEvent *) event
{
- int row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
+ const NSInteger row = [self rowAtPoint: [self convertPoint: [event locationInWindow] fromView: nil]];
if (row >= 0)
{
FileNameCell * cell = (FileNameCell *)[self preparedCellAtColumn: [self columnWithIdentifier: @"Name"] row: row];
NSRect iconRect = [cell imageRectForBounds: [self rectOfRow: row]];
- iconRect.origin.x += [self indentationPerLevel] * (float)([self levelForRow: row] + 1);
+ iconRect.origin.x += [self indentationPerLevel] * (CGFloat)([self levelForRow: row] + 1);
return iconRect;
}
}
}
-- (int) hoveredRow
+- (NSInteger) hoveredRow
{
return fMouseRow;
}
NSGradient * gradient = nil;
NSSet * priorities = [fTorrent filePrioritiesForIndexes: indexes];
- int count = [priorities count];
+ const NSUInteger count = [priorities count];
if (count == 1)
{
switch ([[priorities anyObject] intValue])
BOOL anyActive = false;
for (Torrent * torrent in fTorrents)
{
- [fPeers addObjectsFromArray: [torrent peers]];
- [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
+ if ([torrent webSeedCount] > 0)
+ [fWebSeeds addObjectsFromArray: [torrent webSeeds]];
known += [torrent totalPeersKnown];
if ([torrent isActive])
{
anyActive = YES;
+ [fPeers addObjectsFromArray: [torrent peers]];
+
const NSUInteger connectedThis = [torrent totalPeersConnected];
if (connectedThis > 0)
{
else
activeString = NSLocalizedString(@"Transfers Not Active", "Inspector -> Peers tab -> peers");
- NSString * connectedText = [NSString stringWithFormat: @"%@\n%@", activeString, knownString];
+ NSString * connectedText = [activeString stringByAppendingFormat: @"\n%@", knownString];
[fConnectedPeersField setStringValue: connectedText];
}
}
{
NSMutableArray * webSeeds = [NSMutableArray arrayWithCapacity: fInfo->webseedCount];
- if (fInfo->webseedCount > 0)
+ float * dlSpeeds = tr_torrentWebSpeeds(fHandle);
+
+ for (NSInteger i = 0; i < fInfo->webseedCount; i++)
{
- float * dlSpeeds = tr_torrentWebSpeeds(fHandle);
+ NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 3];
- for (NSInteger i = 0; i < fInfo->webseedCount; i++)
- {
- NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity: 3];
-
- [dict setObject: [self name] forKey: @"Name"];
- [dict setObject: [NSString stringWithUTF8String: fInfo->webseeds[i]] forKey: @"Address"];
-
- if (dlSpeeds[i] != -1.0)
- [dict setObject: [NSNumber numberWithFloat: dlSpeeds[i]] forKey: @"DL From Rate"];
-
- [webSeeds addObject: dict];
- }
+ [dict setObject: [self name] forKey: @"Name"];
+ [dict setObject: [NSString stringWithUTF8String: fInfo->webseeds[i]] forKey: @"Address"];
- tr_free(dlSpeeds);
+ if (dlSpeeds[i] != -1.0)
+ [dict setObject: [NSNumber numberWithFloat: dlSpeeds[i]] forKey: @"DL From Rate"];
+
+ [webSeeds addObject: dict];
}
+ tr_free(dlSpeeds);
+
return webSeeds;
}