various negligible cleanup

This commit is contained in:
Mitchell Livingston
2007-08-14 05:21:02 +00:00
parent f69012d0e7
commit 7ddc2b64cd
8 changed files with 28 additions and 38 deletions
-1
View File
@@ -958,7 +958,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy
didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
}
#warning combine
- (void) openURLEndSheet: (id) sender
{
[fURLSheetWindow orderOut: sender];
+1 -2
View File
@@ -159,8 +159,7 @@
- (void) dealloc
{
[fPath release];
if (fLocation)
[fLocation release];
[fLocation release];
if (fInfo)
tr_metaInfoBuilderFree(fInfo);
+2 -4
View File
@@ -74,10 +74,8 @@
{
[fBackBadge release];
if (fBadge)
[fBadge release];
if (fAppIcon)
[fAppIcon release];
[fBadge release];
[fAppIcon release];
[fMainLineAttributes release];
[fSubLineAttributes release];
+1 -1
View File
@@ -38,7 +38,7 @@
- (id) transformedValue: (id) value
{
return value == nil ? nil : [value lastPathComponent];
return value == nil ? nil : [value lastPathComponent];
}
@end
+3 -3
View File
@@ -70,7 +70,7 @@
[super dealloc];
}
- (void)sizeToFit
- (void) sizeToFit
{
NSSize size = [[self title] sizeWithAttributes: fNormalAttributes];
size.width = floorf(size.width + 18.5);
@@ -80,12 +80,12 @@
[self createPaths];
}
- (BOOL)isFlipped
- (BOOL) isFlipped
{
return NO;
}
- (void)drawRect:(NSRect)rect
- (void) drawRect: (NSRect) rect
{
// draw background
if ([[self cell] isHighlighted])
+2 -4
View File
@@ -28,8 +28,7 @@
- (void) setBackgroundImage: (NSImage *) image
{
if (fBackgroundColor)
[fBackgroundColor release];
[fBackgroundColor release];
fBackgroundColor = [[NSColor colorWithPatternImage: image] retain];
[self setNeedsDisplay: YES];
@@ -37,8 +36,7 @@
- (void) dealloc
{
if (fBackgroundColor)
[fBackgroundColor release];
[fBackgroundColor release];
[super dealloc];
}
+6 -12
View File
@@ -115,20 +115,16 @@
- (void) dealloc
{
if (fTorrents)
[fTorrents release];
if (fPeers)
[fPeers release];
if (fFiles)
[fFiles release];
[fTorrents release];
[fPeers release];
[fFiles release];
[super dealloc];
}
- (void) updateInfoForTorrents: (NSArray *) torrents
{
if (fTorrents)
[fTorrents release];
[fTorrents release];
fTorrents = [torrents retain];
int numberSelected = [fTorrents count];
@@ -286,8 +282,7 @@
//set file table
[fFileOutline deselectAll: nil];
if (fFiles)
[fFiles release];
[fFiles release];
fFiles = [[torrent fileList] retain];
[self updateInfoFiles];
@@ -435,8 +430,7 @@
[fDownloadingFromField setStringValue: active ? [NSString stringWithInt: [torrent peersSendingToUs]] : @""];
[fUploadingToField setStringValue: active ? [NSString stringWithInt: [torrent peersGettingFromUs]] : @""];
if (fPeers)
[fPeers release];
[fPeers release];
fPeers = [[[torrent peers] sortedArrayUsingDescriptors: [self peerSortDescriptors]] retain];
[fPeerTable reloadData];
+13 -11
View File
@@ -151,20 +151,13 @@
[fGreen2Piece release];
[fGreen3Piece release];
if (fTorrent)
[fTorrent release];
[fTorrent release];
[super dealloc];
}
- (void) setTorrent: (Torrent *) torrent
{
if (fTorrent)
{
[fTorrent release];
if (!torrent)
fTorrent = nil;
}
[fTorrent release];
if (torrent)
{
@@ -192,7 +185,12 @@
}
else
{
[self setImage: [[fBack copy] autorelease]];
fTorrent = nil;
NSImage * newBack = [fBack copy];
[self setImage: newBack];
[newBack release];
[self setNeedsDisplay];
}
}
@@ -203,7 +201,11 @@
return;
if (first)
[self setImage: [[fBack copy] autorelease]];
{
NSImage * newBack = [fBack copy];
[self setImage: newBack];
[newBack release];
}
NSImage * image = [self image];
int8_t * pieces;