don't append "http" to addresses in the proxy address field

This commit is contained in:
Mitchell Livingston 2008-11-09 12:12:29 +00:00
parent 73eb503b4c
commit 00ab31b454
3 changed files with 7 additions and 19 deletions

View File

@ -715,22 +715,10 @@ tr_handle * fHandle;
- (void) setProxyAddress: (id) sender - (void) setProxyAddress: (id) sender
{ {
NSString * address = [sender stringValue]; NSString * address = [sender stringValue];
BOOL blank = [address isEqualToString: @""];
if (!blank && [address rangeOfString: @"://"].location == NSNotFound) tr_sessionSetProxy(fHandle, [address UTF8String]);
address = [@"http://" stringByAppendingString: address]; [sender setStringValue: address];
[fDefaults setObject: address forKey: @"ProxyAddress"];
if (blank || tr_httpIsValidURL([address UTF8String]))
{
tr_sessionSetProxy(fHandle, [address UTF8String]);
[sender setStringValue: address];
[fDefaults setObject: address forKey: @"ProxyAddress"];
}
else
{
NSBeep();
[sender setStringValue: [fDefaults stringForKey: @"ProxyAddress"]];
}
} }
- (void) setProxyPort: (id) sender - (void) setProxyPort: (id) sender

View File

@ -747,10 +747,10 @@
if (start) if (start)
visibleRect.origin.y += height; visibleRect.origin.y += height;
for (NSInteger i = start ? 1 : 0; i<numberOfRects; i += 2) for (NSInteger i = start ? 1 : 0; i < numberOfRects; i += 2)
{ {
NSRectFill(visibleRect); NSRectFill(visibleRect);
visibleRect.origin.y += 2 * height; visibleRect.origin.y += 2.0 * height;
} }
[super highlightSelectionInClipRect: clipRect]; [super highlightSelectionInClipRect: clipRect];

View File

@ -93,10 +93,10 @@
if (start) if (start)
visibleRect.origin.y += height; visibleRect.origin.y += height;
for (NSInteger i = start ? 1 : 0; i<numberOfRects; i += 2) for (NSInteger i = start ? 1 : 0; i < numberOfRects; i += 2)
{ {
NSRectFill(visibleRect); NSRectFill(visibleRect);
visibleRect.origin.y += 2 * height; visibleRect.origin.y += 2.0 * height;
} }
[super highlightSelectionInClipRect: clipRect]; [super highlightSelectionInClipRect: clipRect];