1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-23 08:13:27 +00:00

fix a redundant check...all this destination code probably needs cleaning up sooner or later

This commit is contained in:
Mitchell Livingston 2007-10-13 13:54:19 +00:00
parent 9211c57ad2
commit c1cffff4a4
2 changed files with 7 additions and 12 deletions

View file

@ -25,6 +25,8 @@
#import "DragOverlayView.h" #import "DragOverlayView.h"
#import "NSBezierPathAdditions.h" #import "NSBezierPathAdditions.h"
#define PADDING 10.0
@implementation DragOverlayView @implementation DragOverlayView
- (id) initWithFrame: (NSRect) frame - (id) initWithFrame: (NSRect) frame
@ -86,7 +88,6 @@
- (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine - (void) setOverlay: (NSImage *) icon mainLine: (NSString *) mainLine subLine: (NSString *) subLine
{ {
if (fBadge)
[fBadge release]; [fBadge release];
fBadge = [fBackBadge copy]; fBadge = [fBackBadge copy];
NSSize badgeSize = [fBadge size]; NSSize badgeSize = [fBadge size];
@ -110,12 +111,10 @@
[icon setSize: iconSize]; [icon setSize: iconSize];
} }
float padding = 10.0;
[fBadge lockFocus]; [fBadge lockFocus];
//place icon //place icon
[icon compositeToPoint: NSMakePoint(padding, (badgeSize.height - iconSize.height) * 0.5) [icon compositeToPoint: NSMakePoint(PADDING, (badgeSize.height - iconSize.height) * 0.5)
operation: NSCompositeSourceOver]; operation: NSCompositeSourceOver];
[icon release]; [icon release];
@ -123,9 +122,9 @@
NSSize mainLineSize = [mainLine sizeWithAttributes: fMainLineAttributes]; NSSize mainLineSize = [mainLine sizeWithAttributes: fMainLineAttributes];
NSSize subLineSize = [subLine sizeWithAttributes: fSubLineAttributes]; NSSize subLineSize = [subLine sizeWithAttributes: fSubLineAttributes];
NSRect lineRect = NSMakeRect(padding + iconSize.width + 5.0, NSRect lineRect = NSMakeRect(PADDING + iconSize.width + 5.0,
(badgeSize.height + (subLineSize.height + 2.0 - mainLineSize.height)) * 0.5, (badgeSize.height + (subLineSize.height + 2.0 - mainLineSize.height)) * 0.5,
badgeSize.width - (padding + iconSize.width + 2.0) - padding, mainLineSize.height); badgeSize.width - (PADDING + iconSize.width + 2.0) - PADDING, mainLineSize.height);
[mainLine drawInRect: lineRect withAttributes: fMainLineAttributes]; [mainLine drawInRect: lineRect withAttributes: fMainLineAttributes];
//place sub text //place sub text

View file

@ -555,11 +555,7 @@ void completenessChangeCallback(tr_torrent * torrent, cp_status_t status, void *
if (code != NSOKButton) if (code != NSOKButton)
return; return;
NSString * folder = [[openPanel filenames] objectAtIndex: 0]; [self changeDownloadFolder: [[openPanel filenames] objectAtIndex: 0]];
if (fUseIncompleteFolder)
[self changeDownloadFolder: folder];
else
[self changeDownloadFolder: folder];
[self startTransfer]; [self startTransfer];
[self update]; [self update];