From: Eric Petit Date: Fri, 26 Sep 2008 09:09:15 +0000 (+0000) Subject: More Mac fixes X-Git-Tag: 1.40~281 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ecd5ea21fe0ce79a678544c9226857c0b979676e;p=transmission More Mac fixes --- diff --git a/macosx/PrefsController.m b/macosx/PrefsController.m index 0bedd0e92..5fac1df69 100644 --- a/macosx/PrefsController.m +++ b/macosx/PrefsController.m @@ -888,12 +888,7 @@ tr_handle * fHandle; NSString * string = [components componentsJoinedByString: @","]; - char * error = NULL; - if (tr_sessionSetRPCACL(fHandle, [string UTF8String], &error)) - { - NSLog([NSString stringWithUTF8String: error]); - tr_free(error); - } + tr_sessionSetRPCACL(fHandle, [string UTF8String]); } - (void) addRemoveRPCIP: (id) sender @@ -975,24 +970,13 @@ tr_handle * fHandle; NSString * newIP = [newComponents componentsJoinedByString: @"."]; - //verify ip string - if (!tr_sessionTestRPCACL(fHandle, [[@"+" stringByAppendingString: newIP] UTF8String], NULL)) - { - NSDictionary * newDict = [NSDictionary dictionaryWithObjectsAndKeys: newIP, @"IP", - [oldDict objectForKey: @"Allow"], @"Allow", nil]; - [fRPCAccessArray replaceObjectAtIndex: row withObject: newDict]; - - NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"IP" ascending: YES - selector: @selector(compareNumeric:)] autorelease]; - [fRPCAccessArray sortUsingDescriptors: [NSArray arrayWithObject: descriptor]]; - } - else - { - NSBeep(); - - if ([[oldDict objectForKey: @"IP"] isEqualToString: @""]) - [fRPCAccessArray removeObjectAtIndex: row]; - } + NSDictionary * newDict = [NSDictionary dictionaryWithObjectsAndKeys: newIP, @"IP", + [oldDict objectForKey: @"Allow"], @"Allow", nil]; + [fRPCAccessArray replaceObjectAtIndex: row withObject: newDict]; + + NSSortDescriptor * descriptor = [[[NSSortDescriptor alloc] initWithKey: @"IP" ascending: YES + selector: @selector(compareNumeric:)] autorelease]; + [fRPCAccessArray sortUsingDescriptors: [NSArray arrayWithObject: descriptor]]; [fRPCAccessTable deselectAll: self]; [fRPCAccessTable reloadData];